]> granicus.if.org Git - python/commitdiff
Issue #16495: remove extraneous NULL encoding check from bytes_decode().
authorChris Jerdonek <chris.jerdonek@gmail.com>
Fri, 7 Dec 2012 23:51:53 +0000 (15:51 -0800)
committerChris Jerdonek <chris.jerdonek@gmail.com>
Fri, 7 Dec 2012 23:51:53 +0000 (15:51 -0800)
The NULL encoding check in bytes_decode() was unnecessary because this case
is already taken care of by the call to _Py_normalize_encoding() inside
PyUnicode_Decode().

Misc/NEWS
Objects/bytesobject.c

index 1f2687a12e12949eaa0e4f72af97b8673ed35c11..874e12aea2eb4221de385ba59bf52cb8344f2861 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,8 @@ What's New in Python 3.4.0 Alpha 1?
 Core and Builtins
 -----------------
 
+- Issue #16495: Remove extraneous NULL encoding check from bytes_decode().
+
 - Issue #16619: Create NameConstant AST class to represent None, True, and False
   literals. As a result, these constants are never loaded at runtime from
   builtins.
index a1db7789f15a2cc01d8309dc501c69a71edafa69..8d8cb05b11314b2890302b14df0834b6e83ac2f1 100644 (file)
@@ -2236,8 +2236,6 @@ bytes_decode(PyObject *self, PyObject *args, PyObject *kwargs)
 
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|ss:decode", kwlist, &encoding, &errors))
         return NULL;
-    if (encoding == NULL)
-        encoding = PyUnicode_GetDefaultEncoding();
     return PyUnicode_FromEncodedObject(self, encoding, errors);
 }