classification
Title: io.IncrementalNewlineDecoder assign out-of-range value to bitwise struct field
Type: behavior Stage: resolved
Components: IO Versions: Python 3.8, Python 3.7, Python 3.6, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: miss-islington, pablogsal, xiang.zhang, xtreak
Priority: normal Keywords: patch

Created on 2018-10-25 04:03 by xiang.zhang, last changed 2018-10-31 12:39 by xiang.zhang. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 10217 merged xiang.zhang, 2018-10-29 15:19
PR 10259 merged miss-islington, 2018-10-31 11:49
PR 10260 merged miss-islington, 2018-10-31 11:49
PR 10262 merged miss-islington, 2018-10-31 11:49
Messages (5)
msg328407 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2018-10-25 04:03
io.IncrementalNewlineDecoder gets a *translate* bitwise struct field, but it could be assigned arbitrary int value. This leads to inconsistent behaviour, evens are evaluated to False and odds to True.

>>> io.IncrementalNewlineDecoder(encodings.utf_8.IncrementalDecoder(), 4).decode(b"abcd\r\n")
u'abcd\r\n'
>>> io.IncrementalNewlineDecoder(encodings.utf_8.IncrementalDecoder(), 5).decode(b"abcd\r\n")
u'abcd\n'
msg328988 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2018-10-31 11:49
New changeset b08746bfdf64e55ce33516f2065fa2aa4f51be95 by Xiang Zhang in branch 'master':
bpo-35062: Fix parsing _io.IncrementalNewlineDecoder's *translate* argument. (GH-10217)
https://github.com/python/cpython/commit/b08746bfdf64e55ce33516f2065fa2aa4f51be95
msg328991 - (view) Author: miss-islington (miss-islington) Date: 2018-10-31 12:36
New changeset 71b6c1af727fbe13525fb734568057d78cea33f3 by Miss Islington (bot) in branch '3.7':
bpo-35062: Fix parsing _io.IncrementalNewlineDecoder's *translate* argument. (GH-10217)
https://github.com/python/cpython/commit/71b6c1af727fbe13525fb734568057d78cea33f3
msg328992 - (view) Author: miss-islington (miss-islington) Date: 2018-10-31 12:36
New changeset 907b07ee31a657914dafb0a6b7fa724be0f8d8ac by Miss Islington (bot) in branch '3.6':
bpo-35062: Fix parsing _io.IncrementalNewlineDecoder's *translate* argument. (GH-10217)
https://github.com/python/cpython/commit/907b07ee31a657914dafb0a6b7fa724be0f8d8ac
msg328993 - (view) Author: miss-islington (miss-islington) Date: 2018-10-31 12:37
New changeset 05acd44ad6b61adb24571eb0203de7b25c7e869b by Miss Islington (bot) in branch '2.7':
bpo-35062: Fix parsing _io.IncrementalNewlineDecoder's *translate* argument. (GH-10217)
https://github.com/python/cpython/commit/05acd44ad6b61adb24571eb0203de7b25c7e869b
History
Date User Action Args
2018-10-31 12:39:33xiang.zhangsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-10-31 12:37:10miss-islingtonsetmessages: + msg328993
2018-10-31 12:36:37miss-islingtonsetmessages: + msg328992
2018-10-31 12:36:24miss-islingtonsetnosy: + miss-islington
messages: + msg328991
2018-10-31 11:49:48miss-islingtonsetpull_requests: + pull_request9573
2018-10-31 11:49:38miss-islingtonsetpull_requests: + pull_request9571
2018-10-31 11:49:29miss-islingtonsetpull_requests: + pull_request9570
2018-10-31 11:49:21xiang.zhangsetmessages: + msg328988
2018-10-29 15:19:03xiang.zhangsetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request9534
2018-10-26 00:09:21pablogsalsetnosy: + pablogsal
2018-10-25 05:25:32xtreaksetnosy: + xtreak
2018-10-25 04:03:41xiang.zhangcreate