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 2.7 cannot parse ''
Type: behavior Stage: resolved
Components: Unicode Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: ezio.melotti, vstinner, wt19880712wt
Priority: normal Keywords:

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:55adminsetgithub: 76467
2017-12-12 08:49:49vstinnersetstatus: open -> closed
resolution: not a bug
messages: + msg308094

stage: resolved
2017-12-12 08:22:59wt19880712wtsettype: behavior
messages: + msg308093
2017-12-12 08:20:10wt19880712wtcreate