[Patches] [ python-Patches-1714700 ] os.linesep needs clarification

SourceForge.net noreply at sourceforge.net
Fri May 11 13:05:12 CEST 2007


Patches item #1714700, was opened at 2007-05-08 02:54
Message generated for change (Comment added) made by gbrandl
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1714700&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: Python 2.5
>Status: Closed
>Resolution: Accepted
Priority: 5
Private: No
Submitted By: Gabriel Genellina (gagenellina)
Assigned to: Nobody/Anonymous (nobody)
Summary: os.linesep needs clarification

Initial Comment:
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).


----------------------------------------------------------------------

>Comment By: Georg Brandl (gbrandl)
Date: 2007-05-11 11:05

Message:
Logged In: YES 
user_id=849994
Originator: NO

Thanks, committed in rev. 55257, 55258.

----------------------------------------------------------------------

Comment By: Gabriel Genellina (gagenellina)
Date: 2007-05-08 02:58

Message:
Logged In: YES 
user_id=479790
Originator: YES

File Added: oslinesep.diff

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1714700&group_id=5470


More information about the Patches mailing list