37 lines
1.2 KiB
Plaintext
37 lines
1.2 KiB
Plaintext
From: guido at eric.cnri.reston.va.us (Guido van Rossum)
|
|
Date: 04 May 1999 11:00:18 -0400
|
|
Subject: Interpreter fussy about line endings?
|
|
References: <372E4C7B.346A942@compaq.com>
|
|
Message-ID: <5lzp3k98xp.fsf@eric.cnri.reston.va.us>
|
|
X-UID: 1893
|
|
|
|
Greg Ewing <greg.ewing at compaq.com> writes:
|
|
|
|
> Python 1.5.1 on my Mac refuses to run code
|
|
> written using PythonWin's built-in editor,
|
|
> apparently because of different CR/LF
|
|
> conventions. I have to load it into Alpha
|
|
> and save it in Mac format before it will
|
|
> work!
|
|
>
|
|
> Is it meant to be like this? Why should
|
|
> it care? How is one supposed to write
|
|
> cross-platform Python code if it does
|
|
> things like this?
|
|
|
|
Python (by virtue of the C stdio library) expects the line ending
|
|
convention of the platform. Typically, file transfer utilities
|
|
(e.g. FTP) take care of translating line ending conventions for text
|
|
files.
|
|
|
|
For future versions, I may adapt the Java convention (lines are ended
|
|
by CR, LF or CRLF) but for now, you have to translate line endings
|
|
when you transfer files. And yes, I know that is sometimes a pain.
|
|
Live with it.
|
|
|
|
--Guido van Rossum (home page: http://www.python.org/~guido/)
|
|
|
|
|
|
|
|
|