[ python-Bugs-745097 ] urllib2 doesn't handle urls without scheme

SourceForge.net noreply at sourceforge.net
Thu May 19 22:24:34 CEST 2005


Bugs item #745097, was opened at 2003-05-28 19:54
Message generated for change (Comment added) made by jjlee
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=745097&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: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Jack Jansen (jackjansen)
Assigned to: Nobody/Anonymous (nobody)
Summary: urllib2 doesn't handle urls without scheme

Initial Comment:
urllib2.urlopen does not handle URLs without a scheme, so the 
following code will not work:
    url = urllib.pathname2url('/etc/passwd')
    urllib2.urlopen(url)
The same code does work with urllib.urlopen.

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

Comment By: John J Lee (jjlee)
Date: 2005-05-19 21:24

Message:
Logged In: YES 
user_id=261020

Could somebody close this?


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

Comment By: John J Lee (jjlee)
Date: 2003-11-30 23:24

Message:
Logged In: YES 
user_id=261020

Is it wise to allow this?  Maybe it's unlikely to cause bugs, but 
"/etc/passwd" could refer to any URI scheme, not only file:. 
 
Since it seems reasonable to only allow absolute URLs, I think 
it's a bad idea to guess the scheme is file: when given a 
relative URL. 

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

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


More information about the Python-bugs-list mailing list