Re: python tutorial
- From: Robert Kern <robert.kern@xxxxxxxxx>
- Date: Wed, 17 Jun 2009 20:37:52 -0500
On 2009-06-17 19:36, steve wrote:
"Carl Banks"<pavlovevidence@xxxxxxxxx> wrote in message
news:2f6271b1-5ffa-4cec-81f8->>0276ad647026@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Jun 15, 7:56 pm, "steve"<st...@xxxxxxxxx> wrote:
I was just looking at the python tutorial, and I noticed these lines:What's wrong with it?
http://docs.python.org/tutorial/inputoutput.html#reading-and-writing-...
"Windows makes a distinction between text and binary files;
"the end-of-line characters in text files are automatically altered
"slightly when data is read or written.
I don't see any obvious way to at docs.python.org to get that corrected:
Is
there some standard procedure?
Carl Banks
1) Windows does not make a distinction between text and binary files.
2) end-of-line characters in text files are not automatically altered by
Windows.
The Windows implementation of the C standard makes the distinction. E.g. using stdio to write out "foo\nbar\n" in a file opened in text mode will result in "foo\r\nbar\r\n" in the file. Reading such a file in text mode will result in "foo\nbar\n" in memory. Reading such a file in binary mode will result in "foo\r\nbar\r\n". In your bug report, you point out several proprietary APIs that do not make such a distinction, but that does not remove the implementations of the standard APIs that do make such a distinction.
http://msdn.microsoft.com/en-us/library/yeby3zcb.aspx
Perhaps it's a bit dodgy to blame "Windows" per se rather than its C runtime, but I think it's a reasonable statement on the whole.
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco
.
- Follow-Ups:
- Re: python tutorial
- From: steve
- Re: python tutorial
- References:
- python tutorial
- From: steve
- Re: python tutorial
- From: Carl Banks
- Re: python tutorial
- From: steve
- python tutorial
- Prev by Date: Re: Exotic Logics
- Next by Date: Re: python tutorial
- Previous by thread: Re: python tutorial
- Next by thread: Re: python tutorial
- Index(es):
Relevant Pages
|