← Back to DAGDA | Support | Source: https://bugs.python.org/issue24779

➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Python/ast.c: decode_unicode is never called with rawmode=True
Type: Stage: resolved
Components: Interpreter Core Versions: Python 3.6, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: eric.smith Nosy List: brett.cannon, eric.smith, python-dev
Priority: normal Keywords:

Created on 2015-08-02 16:32 by eric.smith, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (4)
msg247880 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2015-08-02 16:32
The only call to decode_unicode is this:

if (!*bytesmode && !rawmode) {
    return decode_unicode(c, s, len, rawmode, c->c_encoding);
}

So rawmode will always be 0. Removing this will delete a call to PyUnicode_DecodeRawUnicodeEscape in decode_unicode.
msg247884 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2015-08-02 16:56
That's poor wording on my part: the call to PyUnicode_DecodeRawUnicodeEscape isn't actually execute if rawmode is false. So it's really just a dead branch that's being deleted.
msg247885 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2015-08-02 17:58
Then I say delete it.
msg251244 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-09-21 17:36
New changeset 5230115de64d by Eric V. Smith in branch 'default':
Issue #24779: Remove unused rawmode parameter to unicode_decode.
https://hg.python.org/cpython/rev/5230115de64d
History
Date User Action Args
2022-04-11 14:58:19adminsetgithub: 68967
2015-09-21 17:37:25eric.smithsetstatus: open -> closed
resolution: fixed
stage: resolved
2015-09-21 17:36:19python-devsetnosy: + python-dev
messages: + msg251244
2015-09-06 18:44:17brett.cannonsetassignee: eric.smith
2015-08-02 17:58:01brett.cannonsetnosy: + brett.cannon
messages: + msg247885
2015-08-02 16:56:51eric.smithsetmessages: + msg247884
2015-08-02 16:32:37eric.smithcreate