Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3c136e1

Browse files
committed
Merge
2 parents 978da33 + 010a948 commit 3c136e1

10 files changed

Lines changed: 601 additions & 58 deletions

File tree

Doc/library/email.parser.rst

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,21 +102,16 @@ as a string. :class:`HeaderParser` has the same API as the :class:`Parser`
102102
class.
103103

104104

105-
.. class:: Parser(_class=email.message.Message, strict=None)
105+
.. class:: Parser(_class=email.message.Message)
106106

107107
The constructor for the :class:`Parser` class takes an optional argument
108108
*_class*. This must be a callable factory (such as a function or a class), and
109109
it is used whenever a sub-message object needs to be created. It defaults to
110110
:class:`~email.message.Message` (see :mod:`email.message`). The factory will
111111
be called without arguments.
112112

113-
The optional *strict* flag is ignored.
114-
115-
.. deprecated:: 2.4
116-
Because the :class:`Parser` class is a backward compatible API wrapper
117-
around the new-in-Python 2.4 :class:`FeedParser`, *all* parsing is
118-
effectively non-strict. You should simply stop passing a *strict* flag to
119-
the :class:`Parser` constructor.
113+
.. versionchanged:: 3.2
114+
Removed the *strict* argument that was deprecated in 2.4.
120115

121116
The other public :class:`Parser` methods are:
122117

Doc/library/urllib.request.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,10 @@ HTTPRedirectHandler Objects
650650
is the case, :exc:`HTTPError` is raised. See :rfc:`2616` for details of the
651651
precise meanings of the various redirection codes.
652652

653+
An :class:`HTTPError` exception raised as a security consideration if the
654+
HTTPRedirectHandler is presented with a redirected url which is not an HTTP,
655+
HTTPS or FTP url.
656+
653657

654658
.. method:: HTTPRedirectHandler.redirect_request(req, fp, code, msg, hdrs, newurl)
655659

Lib/email/parser.py

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616

1717
class Parser:
18-
def __init__(self, *args, **kws):
18+
def __init__(self, _class=Message):
1919
"""Parser of RFC 2822 and MIME email messages.
2020
2121
Creates an in-memory object tree representing the email message, which
@@ -31,27 +31,7 @@ def __init__(self, *args, **kws):
3131
must be created. This class must have a constructor that can take
3232
zero arguments. Default is Message.Message.
3333
"""
34-
if len(args) >= 1:
35-
if '_class' in kws:
36-
raise TypeError("Multiple values for keyword arg '_class'")
37-
kws['_class'] = args[0]
38-
if len(args) == 2:
39-
if 'strict' in kws:
40-
raise TypeError("Multiple values for keyword arg 'strict'")
41-
kws['strict'] = args[1]
42-
if len(args) > 2:
43-
raise TypeError('Too many arguments')
44-
if '_class' in kws:
45-
self._class = kws['_class']
46-
del kws['_class']
47-
else:
48-
self._class = Message
49-
if 'strict' in kws:
50-
warnings.warn("'strict' argument is deprecated (and ignored)",
51-
DeprecationWarning, 2)
52-
del kws['strict']
53-
if kws:
54-
raise TypeError('Unexpected keyword arguments')
34+
self._class = _class
5535

5636
def parse(self, fp, headersonly=False):
5737
"""Create a message structure from the data in a file.

Lib/logging/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2001-2010 by Vinay Sajip. All Rights Reserved.
1+
# Copyright 2001-2011 by Vinay Sajip. All Rights Reserved.
22
#
33
# Permission to use, copy, modify, and distribute this software and its
44
# documentation for any purpose and without fee is hereby granted,
@@ -18,7 +18,7 @@
1818
Logging package for Python. Based on PEP 282 and comments thereto in
1919
comp.lang.python, and influenced by Apache's log4j system.
2020
21-
Copyright (C) 2001-2010 Vinay Sajip. All Rights Reserved.
21+
Copyright (C) 2001-2011 Vinay Sajip. All Rights Reserved.
2222
2323
To use, simply 'import logging' and log away!
2424
"""
@@ -1826,10 +1826,10 @@ class NullHandler(Handler):
18261826
package.
18271827
"""
18281828
def handle(self, record):
1829-
pass
1829+
"""Stub."""
18301830

18311831
def emit(self, record):
1832-
pass
1832+
"""Stub."""
18331833

18341834
def createLock(self):
18351835
self.lock = None

0 commit comments

Comments
 (0)