Issue 32286: python 2.7 cannot parse '' (original) (raw)

Issue32286

Created on 2017-12-12 08:20 by wt19880712wt, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
b.txt wt19880712wt,2017-12-12 08:20 this is the file include ''
Messages (3)
msg308091 - (view) Author: wangtie (wt19880712wt) Date: 2017-12-12 08:20
I have a txt file,use code UTF-8,and include char ''(ASCII code?), when use f.readlines() to get a list, the program exit without any exception,then I got a list without data after line which include char ''.
msg308093 - (view) Author: wangtie (wt19880712wt) Date: 2017-12-12 08:22
My ENV: Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:24:40) [MSC v.1500 64 bit ( AMD64)] on win32
msg308094 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-12-12 08:49
Your file is not properly encoded to UTF-8: the Python 2 UTF-8 raises UnicodeDecodeError. Sorry but this is not a bug in Python, but a bug on your side. Please ask such question on the forum to ask Python questions like Stackoverflow or anything else.
History
Date User Action Args
2022-04-11 14:58:55 admin set github: 76467
2017-12-12 08:49:49 vstinner set status: open -> closedresolution: not a bugmessages: + stage: resolved
2017-12-12 08:22:59 wt19880712wt set type: behaviormessages: +
2017-12-12 08:20:10 wt19880712wt create