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: os.linesep needs clarification
Type: Stage:
Components: Documentation Versions: Python 2.5
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, ggenellina
Priority: normal Keywords: patch

Created on 2007-05-08 02:54 by ggenellina, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
oslinesep.diff ggenellina, 2007-05-08 02:58 os.linesep docs updated
Messages (3)
msg52612 - (view) Author: Gabriel Genellina (ggenellina) Date: 2007-05-08 02:54
On bug #1714381 (and in a message on a local Python list), people were trying to write a text file in this "portable" way:

f = open("filename","w")
f.write("Text" + os.linesep)
f.close()

Of course this is wrong, because the "portable" line terminator is just "\n", which gets converted into os.linesep by the C runtime library.

This patch adds a warning to the os.linesep documentation (and fixes a misplaced line break).
msg52613 - (view) Author: Gabriel Genellina (ggenellina) Date: 2007-05-08 02:58
File Added: oslinesep.diff
msg52614 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-05-11 11:05
Thanks, committed in rev. 55257, 55258.
History
Date User Action Args
2022-04-11 14:56:24adminsetgithub: 44942
2007-05-08 02:54:23ggenellinacreate