[New-bugs-announce] [issue2131] "codecs" module on Windows uses incorrect end-of-line, wiriting broken Unicode (UTF-8) files
Technologov
report at bugs.python.org
Sat Feb 16 22:30:47 CET 2008
New submission from Technologov:
"codecs" module on Windows writes incorrect end-of-line, making it
impossible to write Unicode files.
See below, how-to reproduce bug (Python 2.5.1 on Windows XP)
===================================================================
#buggy unicode support module:
import codecs
filewr=codecs.open('myfile.txt','w','utf-8')
filewr.write("abc"+"\n")
===================================================================
Now, try to open this 'myfile.txt' using Windows Notepad.
The bug is perfectly visible.
The code below, will give correct results however:
===================================================================
filewr=open('myfile.txt','w')
filewr.write("abc"+"\n")
===================================================================
Basically this bugs _prevents_ me from writing Unicode text files.
NOTE: I'm not sure, if this bug should relate to "Windows" or "Unicode"
component.
NOTE: This bug is reproducible, even without writing Unicode characters.
-Technologov, 16.02.2008.
----------
components: Unicode
messages: 62470
nosy: Technologov
severity: normal
status: open
title: "codecs" module on Windows uses incorrect end-of-line, wiriting broken Unicode (UTF-8) files
versions: Python 2.5
__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2131>
__________________________________
More information about the New-bugs-announce
mailing list