[issue40416] Calling TextIOWrapper.tell() in the middle of reading a gb2312-encoded file causes UnicodeDecodeError

2020-05-03 Thread Terry J. Reedy
Terry J. Reedy added the comment: The commit referenced above is for #33578. The symptoms for that issue were very similar, including involving a cjk codec. The change was not backported because it was seen an enhancement. Rob, if you try 3.8.2 or 3.8.3 (the release candidate was out Wedn

[issue40416] Calling TextIOWrapper.tell() in the middle of reading a gb2312-encoded file causes UnicodeDecodeError

2020-05-03 Thread Inada Naoki
Inada Naoki added the comment: I think this is not a bug, but a limitation of Python 3.7, and improvement in 3.8. -- nosy: +inada.naoki ___ Python tracker ___ ___

[issue40416] Calling TextIOWrapper.tell() in the middle of reading a gb2312-encoded file causes UnicodeDecodeError

2020-05-02 Thread Ma Lin
Ma Lin added the comment: I did a git bisect, this commit fixed the bug: https://github.com/python/cpython/commit/ac22f6aa989f18c33c12615af1c66c73cf75d5e7 -- ___ Python tracker _

[issue40416] Calling TextIOWrapper.tell() in the middle of reading a gb2312-encoded file causes UnicodeDecodeError

2020-05-02 Thread Ma Lin
Ma Lin added the comment: On Windows 10, Python 3.7, I get the same message as above reply. If use Python 3.8, it works well. -- nosy: +Ma Lin ___ Python tracker ___

[issue40416] Calling TextIOWrapper.tell() in the middle of reading a gb2312-encoded file causes UnicodeDecodeError

2020-05-02 Thread Rob Malouf
Rob Malouf added the comment: Same results on MacOS 10.15.4 (both the system python and the intel/anaconda version) and on CentOS 7.8 Here's the output with print(...): 13 71 72 392 393 399 536 537 761 762 879 880 933 934 1146 1147 1254 1255 1359 1360 1760 1761 1772 1895 1897 1906 2105 2107

[issue40416] Calling TextIOWrapper.tell() in the middle of reading a gb2312-encoded file causes UnicodeDecodeError

2020-05-01 Thread Terry J. Reedy
Terry J. Reedy added the comment: Change the line to 'print(f.tell())'. Are any lines printed before the error? -- ___ Python tracker ___

[issue40416] Calling TextIOWrapper.tell() in the middle of reading a gb2312-encoded file causes UnicodeDecodeError

2020-05-01 Thread Terry J. Reedy
Terry J. Reedy added the comment: OS? in case it matters -- nosy: +terry.reedy ___ Python tracker ___ ___ Python-bugs-list mailing

[issue40416] Calling TextIOWrapper.tell() in the middle of reading a gb2312-encoded file causes UnicodeDecodeError

2020-04-28 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue40416] Calling TextIOWrapper.tell() in the middle of reading a gb2312-encoded file causes UnicodeDecodeError

2020-04-27 Thread Rob Malouf
New submission from Rob Malouf : Calling TextIOWrapper.tell() while reading the attached gb2312-encoded file like this: with open('udhr-gb2312.txt', encoding='GB2312') as f: while True: line = f.readline() t = f.tell() if not line: break gives this res