[Python-bugs-list] [ python-Bugs-772763 ] modulefinder bug in load_module()

SourceForge.net noreply@sourceforge.net
Thu, 17 Jul 2003 09:27:54 -0700


Bugs item #772763, was opened at 2003-07-16 21:20
Message generated for change (Comment added) made by atuining
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=772763&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Anthony Tuininga (atuining)
Assigned to: Just van Rossum (jvr)
Summary: modulefinder bug in load_module()

Initial Comment:
in revision 1.6 of file dist/src/Lib/modulefinder.py at
line 265 there is a line that reads

            co = compile(fp.read()+'\n', pathname, 'exec')

That line should read instead

           co = compile(fp.read().replace("\r\n", "\n")
+'\n', pathname, 'exec')

as otherwise files with Windows line endings do not
compile correctly on Unix platforms. The import
statement itself seems to handle this properly. Perhaps
this can also be done with the universal line endings
"U" option to the open command?


----------------------------------------------------------------------

>Comment By: Anthony Tuininga (atuining)
Date: 2003-07-17 10:27

Message:
Logged In: YES 
user_id=619560

The only problem is that the file is opened within the imp
module when the find_module() method. So this means changes
at the C level, right?

And its already too late for Python 2.3?? I thought it was
still two weeks away from release?

Perhaps the simple fix with the replace() code can be used
for now?

I am not sure about the release strategy so I might be way
off base here. :-)

----------------------------------------------------------------------

Comment By: Just van Rossum (jvr)
Date: 2003-07-17 10:22

Message:
Logged In: YES 
user_id=92689

This should be done with the "U" mode indeed. Can you provide a 
patch? It's too late for 2.3 anyway, so take your time...

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=772763&group_id=5470