This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: imputil.py can't import "\r\n" .py files
Type: Stage:
Components: Library (Lib) Versions: Python 2.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: jhylton Nosy List: gstein, jhylton, lemburg, mitchchapman, mwh
Priority: normal Keywords: patch

Created on 2002-02-28 17:17 by mitchchapman, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
imputil_patch.diff mitchchapman, 2002-02-28 17:17 Context diff
Messages (6)
msg39110 - (view) Author: Mitch Chapman (mitchchapman) Date: 2002-02-28 17:17
__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.
msg39111 - (view) Author: Mitch Chapman (mitchchapman) Date: 2002-03-06 17:03
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.
msg39112 - (view) Author: Marc-Andre Lemburg (lemburg) * (Python committer) Date: 2002-03-06 17:14
Logged In: YES 
user_id=38388

Assigning to Greg Stein -- imputil.py is his baby.
msg39113 - (view) Author: Michael Hudson (mwh) (Python committer) Date: 2002-03-16 16:42
Logged In: YES 
user_id=6656

Greg any chance of comments before 2.2.1c1, i.e. Monday?
msg39114 - (view) Author: Greg Stein (gstein) * (Python committer) Date: 2002-03-18 07:07
Logged In: YES 
user_id=6501

I've been out this weekend, so no... won't make it by Monday
the 18th.
msg39115 - (view) Author: Jeremy Hylton (jhylton) (Python triager) Date: 2002-06-28 23:31
Logged In: YES 
user_id=31392

I fixed this in CVS python by opening file in "rU" mode.
History
Date User Action Args
2022-04-10 16:05:03adminsetgithub: 36181
2002-02-28 17:17:58mitchchapmancreate