Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e7f2186

Browse files
committed
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().
1 parent 527507d commit e7f2186

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ What's New in Python 3.4.0 Alpha 1?
1010
Core and Builtins
1111
-----------------
1212

13+
- Issue #16495: Remove extraneous NULL encoding check from bytes_decode().
14+
1315
- Issue #16619: Create NameConstant AST class to represent None, True, and False
1416
literals. As a result, these constants are never loaded at runtime from
1517
builtins.

Objects/bytesobject.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2236,8 +2236,6 @@ bytes_decode(PyObject *self, PyObject *args, PyObject *kwargs)
22362236

22372237
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|ss:decode", kwlist, &encoding, &errors))
22382238
return NULL;
2239-
if (encoding == NULL)
2240-
encoding = PyUnicode_GetDefaultEncoding();
22412239
return PyUnicode_FromEncodedObject(self, encoding, errors);
22422240
}
22432241

0 commit comments

Comments
 (0)