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: utf8 codec fails to parse a character
Type: Stage:
Components: Unicode Versions: Python 3.1
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Roman.Gershman, vstinner
Priority: normal Keywords:

Created on 2010-05-20 22:01 by Roman.Gershman, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
1.txt Roman.Gershman, 2010-05-20 22:01 an input file which can not be read in python
Messages (2)
msg106195 - (view) Author: Roman Gershman (Roman.Gershman) Date: 2010-05-20 22:01
The following code fails to parse the attached file:


#!/usr/bin/python3.1

if __name__ == '__main__':
 f = open("c:\\1.txt", mode ='r', encoding='utf-8')
 for line in f:
     print (line)
msg106196 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-05-20 22:06
$ hexdump  -C 1.txt 
00000000  ec 0d 0a                                          |...|
00000003

This file is *not* encoded to utf8.
History
Date User Action Args
2022-04-11 14:57:01adminsetgithub: 53025
2010-05-20 22:48:55benjamin.petersonsetstatus: open -> closed
resolution: not a bug
2010-05-20 22:06:46vstinnersetnosy: + vstinner
messages: + msg106196
2010-05-20 22:01:59Roman.Gershmancreate