[ python-Bugs-860155 ] mistake in StringIO.__doc__

SourceForge.net noreply at sourceforge.net
Sun Dec 14 22:45:39 EST 2003


Bugs item #860155, was opened at 2003-12-15 03:45
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=860155&group_id=5470

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Keel Thaan (kmt12)
Assigned to: Nobody/Anonymous (nobody)
Summary: mistake in StringIO.__doc__

Initial Comment:
[Confirmed in both Python 2.1.3 and Python 2.3.2]

There's an error in the doc string for the StringIO
module; it contains this line:

buf = f.readline()  # read until end of line ('\n') or EOF

but since that \n isn't escaped, it gets interpreted as
an actual newline, so printing StringIO.__doc__ results
in this:

buf = f.readline()  # read until end of line ('
') or EOF


I realize this isn't that big a deal, but given how
utterly trivial it is to fix . . . 

Simply making the doc string a raw string would take
care of it.  (You could of course double the backslash
instead, but that has the disadvantage of affecting the
readability of the doc string within the source file
itself.)

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

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



More information about the Python-bugs-list mailing list