Re: Multiline plpython procedure - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Multiline plpython procedure
Date
Msg-id 20050120124219.GA12585@svana.org
Whole thread Raw
In response to Re: Multiline plpython procedure  ("Frank D. Engel, Jr." <fde101@fjrhome.net>)
List pgsql-general
On Wed, Jan 19, 2005 at 07:06:49PM -0500, Frank D. Engel, Jr. wrote:
> Uh, does the Python doc specify "platform" line endings, or "normal
> (\n)" line endings?  It sounded to me like it always wanted the
> UNIX-style \n line endings, so that using those would result in
> portability...

That's the problem, Python specifies "platform" line endings. See this
note:

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66434
> When working between platforms, it is often necessary to convert the
> line endings on files for them to work, especially when it comes to
> code. Pass Unix Python code with \r and it goes nowhere. Same on Mac
> Python with \n. This code simply and easily fixes the problem.

Note, one of these links provides a possible solution:

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/59867
> This code eliminates the need to convert line endings when moving .py
> modules between OSes. Put in your sitecustomize.py, anywhere on
> sys.path, and you'll be able to import Python modules with any of
> Unix, Mac, or Windows line endings, on any OS.

I don't understand how it works, but people claim it solves their
problem...

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment

pgsql-general by date:

Previous
From: Abdul-Wahid Paterson
Date:
Subject: Re: Best Linux Distribution
Next
From: Vittorio
Date:
Subject: Re: Best Linux Distribution