]> granicus.if.org Git - python/commitdiff
Remove bootstrap code of PyUnicode_AsEncodedString()
authorVictor Stinner <victor.stinner@haypocalc.com>
Mon, 21 Feb 2011 20:51:28 +0000 (20:51 +0000)
committerVictor Stinner <victor.stinner@haypocalc.com>
Mon, 21 Feb 2011 20:51:28 +0000 (20:51 +0000)
Issue #11187: Remove bootstrap code (use ASCII) of
PyUnicode_AsEncodedString(), it was replaced by a better fallback (use
the locale encoding) in PyUnicode_EncodeFSDefault().

Prepare also empty sections in NEWS.

Misc/NEWS
Objects/unicodeobject.c

index d01a0e1d93ddd84c898bcda19c65619e6b45167b..e9113209cf389ec65061aed0b5355e03322878e9 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,11 +12,15 @@ Core and Builtins
 
 - Check for NULL result in PyType_FromSpec.
 
+- Issue #11187: Remove bootstrap code (use ASCII) of
+  PyUnicode_AsEncodedString(), it was replaced by a better fallback (use the
+  locale encoding) in PyUnicode_EncodeFSDefault().
+
 Library
 -------
 
 - Issue #11089: Fix performance issue limiting the use of ConfigParser()
-  with large config files. 
+  with large config files.
 
 - Issue #10276: Fix the results of zlib.crc32() and zlib.adler32() on buffers
   larger than 4GB.  Patch by Nadeem Vawda.
index 456719685d48db4c03a74bb25fc4011b50b9ae47..069be7b6c63e1def01dd96c3e404ce15be889516 100644 (file)
@@ -1673,21 +1673,6 @@ PyObject *PyUnicode_AsEncodedString(PyObject *unicode,
                                          PyUnicode_GET_SIZE(unicode),
                                          errors);
     }
-    /* During bootstrap, we may need to find the encodings
-       package, to load the file system encoding, and require the
-       file system encoding in order to load the encodings
-       package.
-
-       Break out of this dependency by assuming that the path to
-       the encodings module is ASCII-only.  XXX could try wcstombs
-       instead, if the file system encoding is the locale's
-       encoding. */
-    if (Py_FileSystemDefaultEncoding &&
-             strcmp(encoding, Py_FileSystemDefaultEncoding) == 0 &&
-             !PyThreadState_GET()->interp->codecs_initialized)
-        return PyUnicode_EncodeASCII(PyUnicode_AS_UNICODE(unicode),
-                                     PyUnicode_GET_SIZE(unicode),
-                                     errors);
 
     /* Encode via the codec registry */
     v = PyCodec_Encode(unicode, encoding, errors);