[Python-Dev] Re: Unix line endings required for PyRun* breakingembedded Python

Alex Martelli aleax at aleax.it
Thu Jan 20 00:32:19 CET 2005


On 2005 Jan 20, at 00:14, Fredrik Lundh wrote:

> Stuart Bishop wrote:
>
>> I don't think it is possible for plpythonu to fix this by simply 
>> translating the line endings, as
>> this would require significant knowledge of Python syntax to do 
>> correctly (triple quoted strings
>> and character escaping I think).
>
> of course it's possible: that's what the interpreter does when it loads
> a script or module, after all...  or in other words,
>
> print repr("""
> """)
>
> always prints "\n" (at least on Unix (\n) and Windows (\r\n)).

Mac, too (but then, that IS Unix to all intents and purposes, nowadays).


Alex



More information about the Python-Dev mailing list