[issue28246] Unable to read simple text file

2016-09-22 Thread AndreyTomsk

AndreyTomsk added the comment:

Thanks for quick reply. I'm new to python, just used tutorial docs and didn't 
read carefully enough to notice encoding info.

Still, IMHO behaviour not consistent. In three sequential symbols in russian 
alphabet - З, И, К, it crashes on И, and displays other in two-byte form.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28246>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28246] Unable to read simple text file

2016-09-22 Thread AndreyTomsk

New submission from AndreyTomsk:

File read operation fails when gets specific cyrillic symbol. Tested with 
script:

testFile = open('ResourceStrings.rc', 'r')
for line in testFile:
print(line)


Exception message:
Traceback (most recent call last):
  File "min_test.py", line 6, in 
for line in testFile:
  File 
"C:\Users\afi\AppData\Local\Programs\Python\Python36\lib\encodings\cp1251.py", 
line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 24: 
character maps to 

--
components: IO, Unicode, Windows
files: ResourceStrings.rc
messages: 277206
nosy: AndreyTomsk, ezio.melotti, haypo, paul.moore, steve.dower, tim.golden, 
zach.ware
priority: normal
severity: normal
status: open
title: Unable to read simple text file
type: behavior
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file44783/ResourceStrings.rc

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28246>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com