[Patches] [ python-Patches-523944 ] imputil.py can't import "\r\n" .py files

noreply@sourceforge.net noreply@sourceforge.net
Sat, 16 Mar 2002 08:42:06 -0800


Patches item #523944, was opened at 2002-02-28 17:17
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=523944&group_id=5470

Category: Library (Lib)
Group: Python 2.2.x
Status: Open
Resolution: None
Priority: 5
Submitted By: Mitch Chapman (mitchchapman)
Assigned to: Greg Stein (gstein)
>Summary: imputil.py can't import "\r\n" .py files

Initial Comment:
__builtin__.compile() requires that codestring line endings consist of
"\n".  imputil._compile() does not enforce this.  One result is that
imputil may be unable to import modules created on Win32.

The attached patch to the latest (CVS revision 1.23) imputil.py
replaces both "\r\n" and "\r" with "\n" before passing a code string
to __builtin__.compile().  This is consistent with the behavior of
e.g. Lib/py_compile.py.


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

>Comment By: Michael Hudson (mwh)
Date: 2002-03-16 16:42

Message:
Logged In: YES 
user_id=6656

Greg any chance of comments before 2.2.1c1, i.e. Monday?

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

Comment By: M.-A. Lemburg (lemburg)
Date: 2002-03-06 17:14

Message:
Logged In: YES 
user_id=38388

Assigning to Greg Stein -- imputil.py is his baby.

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

Comment By: Mitch Chapman (mitchchapman)
Date: 2002-03-06 17:03

Message:
Logged In: YES 
user_id=348188

Please pardon if it's inappropriate to assign patches to project developers.
I'm doing so on the advice of a post by Skip Montanaro.

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

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=523944&group_id=5470