Why 'r' mode anyway?
Irmen de Jong
irmen at -nospam-remove-this-xs4all.nl
Fri Jan 14 15:13:22 EST 2005
Tim Peters wrote:
> That differences may exist is reflected in the C
> standard, and the rules for text-mode files are more restrictive than
> most people would believe.
Apparently. Because I know only about the Unix <-> Windows difference
(windows converts \r\n <--> \n when using 'r' mode, right).
So it's in the line endings.
Is there more obscure stuff going on on the other systems you
mentioned (Mac OS, VAX) ?
(That means that the bug in Simplehttpserver that my patch
839496 addressed, also occured on those systems? Or that
the patch may be incorrect after all??)
While your argument about why Python doesn't use its own platform-
independent file format is sound ofcourse, I find it often a nuisance
that platform specific things tricle trough into Python itself and
ultimately in the programs you write. I sometimes feel that some
parts of Python expose the underlying C/os implementation
a bit too much. Python never claimed write once run anywhere (as
that other language does) but it would have been nice nevertheless ;-)
In practice it's just not possible I guess.
More information about the Python-list