Bugs item #745097, was opened at 2003-05-28 20:54 Message generated for change (Comment added) made by jackjansen 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: Jack Jansen (jackjansen) Date: 2005-05-20 01:53 Message: Logged In: YES user_id=45365 I'm not convinced it isn't a bug. I agree that the URL '/etc/passwd' isn't always a file: url, but I think that in that case urllib2 should get its own pathname2url() method that returns urls with the file: prefix. ---------------------------------------------------------------------- Comment By: John J Lee (jjlee) Date: 2005-05-19 22:24 Message: Logged In: YES user_id=261020 Could somebody close this? ---------------------------------------------------------------------- Comment By: John J Lee (jjlee) Date: 2003-12-01 00: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 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com