]> granicus.if.org Git - python/commitdiff
whatsnew: InspectLoader.get_code now concrete, b32decode raises binascii.Error.
authorR David Murray <rdmurray@bitdance.com>
Wed, 8 Jan 2014 23:16:02 +0000 (18:16 -0500)
committerR David Murray <rdmurray@bitdance.com>
Wed, 8 Jan 2014 23:16:02 +0000 (18:16 -0500)
And a news item rephrase.

Doc/library/importlib.rst
Doc/whatsnew/3.4.rst
Misc/NEWS

index dc29b8aa635385f4fdd4b9f8074f4acb100ff733..a3373e0bb8c4710c4b21beba9dbd56131de9fa52 100644 (file)
@@ -478,10 +478,10 @@ ABC hierarchy::
 
     .. method:: get_code(fullname)
 
-        Return the code object for a module.
-        ``None`` should be returned if the module does not have a code object
-        (e.g. built-in module).  :exc:`ImportError` is raised if loader cannot
-        find the requested module.
+        Return the code object for a module, or ``None`` if the module does not
+        have a code object (as would be the case, for example, for a built-in
+        module).  Raise an :exc:`ImportError` if loader cannot find the
+        requested module.
 
         .. note::
            While the method has a default implementation, it is suggested that
index cac02f16897f25929258fbe927223c3aa7563529..83f151be25f807d0c59dab70d90208056c0c8582 100644 (file)
@@ -750,6 +750,11 @@ data and a path and returns a code object.  The default implementation
 is equivalent to ``compile(data, path, 'exec', dont_inherit=True)``.
 (Contributed by Eric Snow and Brett Cannon in :issue:`15627`.)
 
+:class:`~importlib.abc.InspectLoader` also now has a default implementation
+for the :meth:`~importlib.abc.InspectLoader.get_code` method.  However,
+it will normally be desirable to override the default implementation
+for performance reasons.  (Contributed by Brett Cannon in :issue:`18072`.)
+
 
 inspect
 -------
@@ -1546,6 +1551,13 @@ Changes in the Python API
   :exc:`AttributError`.  In addition, :meth:`~ssl.SSLSocket.getpeercert`
   will raise a :exc:`ValueError` if the handshake has not yet been done.
 
+* :func:`base64.b32decode` now raises a :exc:`binascii.Error` when the
+  input string contains non-b32-alphabet characters, instead of a
+  :exc:`TypeError`.  This particular :exc:`TypeError` was missed when the other
+  :exc:`TypeError`\ s were converted.  (Contributed by Serhiy Storchaka in
+  :issue:`18011`.)  Note: this change was also inadvertently applied in Python
+  3.3.3.
+
 
 Changes in the C API
 --------------------
index 475a5c5ad68f41a2ffa99a71621b3fd25e10a137..82b38505a61c0b2294abc457462d5414cc7d51b4 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -2144,8 +2144,8 @@ Library
 - Issue #17269: Workaround for socket.getaddrinfo crash on MacOS X
   with port None or "0" and flags AI_NUMERICSERV.
 
-- Issue #16986: ElementTree now correctly parses a string input not only when
-  an internal XML encoding is UTF-8 or US-ASCII.
+- Issue #16986: ElementTree now correctly works with string input when the
+  internal XML encoding is not UTF-8 or US-ASCII.
 
 - Issue #17996: socket module now exposes AF_LINK constant on BSD and OSX.