[ python-Bugs-1589480 ] urllib2 does local import of tokenize.py

SourceForge.net noreply at sourceforge.net
Thu Nov 2 21:11:01 CET 2006


Bugs item #1589480, was opened at 2006-11-02 12:10
Message generated for change (Comment added) made by drfarina
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1589480&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Daniel Farina (drfarina)
Assigned to: Nobody/Anonymous (nobody)
Summary: urllib2 does local import of tokenize.py

Initial Comment:
urllib2 may do a relative import of tokenize.py, which
can cause it to function abnormally when the user has a
file named "tokenizer.py" in the directory as a script
that utilizes urllib2.

The attached tarball has a shell script called
"showme.sh" that will give standard input to afile.py,
which contains two import statements and nothing else.
Code in the neighboring tokenize.py will be executed,
resulting in printing those lines to standard output.

Expected behavior:
no code in tokenize.py should be executed.

Reproducible on Ubuntu 6.10


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

>Comment By: Daniel Farina (drfarina)
Date: 2006-11-02 12:11

Message:
Logged In: YES 
user_id=425987

Typo in the above:

"tokenizer.py" should just be "tokenize.py"

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

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


More information about the Python-bugs-list mailing list