diff options
| -rw-r--r-- | Doc/howto/descriptor.rst | 2 | ||||
| -rw-r--r-- | Doc/library/logging.handlers.rst | 8 | ||||
| -rw-r--r-- | Doc/library/stdtypes.rst | 10 | ||||
| -rw-r--r-- | Doc/reference/expressions.rst | 2 | ||||
| -rw-r--r-- | Lib/test/test_urllib2net.py | 24 |
5 files changed, 33 insertions, 13 deletions
diff --git a/Doc/howto/descriptor.rst b/Doc/howto/descriptor.rst index 81bb8ca..1616f67 100644 --- a/Doc/howto/descriptor.rst +++ b/Doc/howto/descriptor.rst @@ -42,7 +42,7 @@ classes (a class is new style if it inherits from :class:`object` or Descriptors are a powerful, general purpose protocol. They are the mechanism behind properties, methods, static methods, class methods, and :func:`super()`. -They are used used throughout Python itself to implement the new style classes +They are used throughout Python itself to implement the new style classes introduced in version 2.2. Descriptors simplify the underlying C-code and offer a flexible set of new tools for everyday Python programs. diff --git a/Doc/library/logging.handlers.rst b/Doc/library/logging.handlers.rst index 378c071..a18cf92 100644 --- a/Doc/library/logging.handlers.rst +++ b/Doc/library/logging.handlers.rst @@ -614,7 +614,7 @@ The :class:`SMTPHandler` class, located in the :mod:`logging.handlers` module, supports sending logging messages to an email address via SMTP. -.. class:: SMTPHandler(mailhost, fromaddr, toaddrs, subject, credentials=None) +.. class:: SMTPHandler(mailhost, fromaddr, toaddrs, subject, credentials=None, secure=None) Returns a new instance of the :class:`SMTPHandler` class. The instance is initialized with the from and to addresses and subject line of the email. The @@ -623,6 +623,12 @@ supports sending logging messages to an email address via SMTP. the standard SMTP port is used. If your SMTP server requires authentication, you can specify a (username, password) tuple for the *credentials* argument. + To specify the use of a secure protocol (TLS), pass in a tuple to the + *secure* argument. This will only be used when authentication credentials are + supplied. The tuple should be either an empty tuple, or a single-value tuple + with the name of a keyfile, or a 2-value tuple with the names of the keyfile + and certificate file. (This tuple is passed to the + :meth:`smtplib.SMTP.starttls` method.) .. method:: emit(record) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index e43fc04..57a60ed 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -2712,6 +2712,16 @@ special operations. There is exactly one ellipsis object, named It is written as ``Ellipsis`` or ``...``. +The NotImplemented Object +------------------------- + +This object is returned from comparisons and binary operations when they are +asked to operate on types they don't support. See :ref:`comparisons` for more +information. + +It is written as ``NotImplemented``. + + Boolean Values -------------- diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst index d85a9c6..655ebde 100644 --- a/Doc/reference/expressions.rst +++ b/Doc/reference/expressions.rst @@ -673,7 +673,7 @@ there were no excess keyword arguments. If the syntax ``*expression`` appears in the function call, ``expression`` must evaluate to an iterable. Elements from this iterable are treated as if they were additional positional arguments; if there are positional arguments -*x1*, ... ,*xN*, and ``expression`` evaluates to a sequence *y1*, ..., *yM*, +*x1*, ..., *xN*, and ``expression`` evaluates to a sequence *y1*, ..., *yM*, this is equivalent to a call with M+N positional arguments *x1*, ..., *xN*, *y1*, ..., *yM*. diff --git a/Lib/test/test_urllib2net.py b/Lib/test/test_urllib2net.py index cd225c9..54f4e0c 100644 --- a/Lib/test/test_urllib2net.py +++ b/Lib/test/test_urllib2net.py @@ -178,17 +178,21 @@ class OtherNetworkTests(unittest.TestCase): # Some sites do not send Connection: close header. # Verify that those work properly. (#issue12576) - try: - with urllib.request.urlopen('http://www.imdb.com') as res: - pass - except ValueError as e: - self.fail("urlopen failed for sites not sending Connection:close") - else: - self.assertTrue(res) + URL = 'http://www.imdb.com' # mangles Connection:close + + with support.transient_internet(URL): + try: + with urllib.request.urlopen(URL) as res: + pass + except ValueError as e: + self.fail("urlopen failed for site not sending \ + Connection:close") + else: + self.assertTrue(res) - req = urllib.request.urlopen('http://www.imdb.com') - res = req.read() - self.assertTrue(res) + req = urllib.request.urlopen(URL) + res = req.read() + self.assertTrue(res) def _test_urls(self, urls, handlers, retry=True): import time |
