[Python-Dev] Import hook to do end-of-line conversion?

Jack Jansen jack@oratrix.nl
Sat, 07 Apr 2001 14:00:15 +0200

[Oops, try again]

There's talk on the PythonMac-SIG to create an import hook that would
read modules with either \r, \n or \r\n newlines and convert them to
the local convention before feeding them to the rest of the import
machinery. The reason this has become interesting is the mixed
unixness/macness of MacOSX, where such an import hook could be used to
share a Python tree between MacPython and bsd-Python. They would only
need a different site.py (probably), living somehwere near the head of
sys.path, that would be in local end of line convention and enable the

However, it seem that such a module would have a much more general
scope, for instance if you're accessing samba partitions from windows,
or other foreign file systems, etc.

Does this sound like a good idea? And (even better:-) has anyone done
this already? Would it be of enough interest to include it in the
core Lib?
Jack Jansen             | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.oratrix.nl/~jack    | ++++ see http://www.xs4all.nl/~tank/ ++++