summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Jerdonek <chris.jerdonek@gmail.com>2012-12-07 15:51:53 -0800
committerChris Jerdonek <chris.jerdonek@gmail.com>2012-12-07 15:51:53 -0800
commite7f2186f994f84e050b869559132d28d4fe26614 (patch)
tree128bfbc5965fdd44e4342fdfa5ec96ef65e31194
parent527507d72ef2374ecd9f53f1a0a3c00783b73f4e (diff)
downloadcpython-git-e7f2186f994f84e050b869559132d28d4fe26614.tar.gz
Issue #16495: remove extraneous NULL encoding check from bytes_decode().
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().
-rw-r--r--Misc/NEWS2
-rw-r--r--Objects/bytesobject.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 1f2687a12e..874e12aea2 100644
--- 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.
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index a1db7789f1..8d8cb05b11 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -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);
}