On Mon, May 24, 2010 at 08:49:56AM +0000, Vinay Sajip wrote: > I encountered what seems like an incompatibility between urllib and urllib2 in > the way they handle file:// URLs, is this a bug? I had a look on the bug > tracker
> >>> s = 'file:////tmp/hello.txt' > >>> f1 = urllib.urlopen(s) The actual (and Valid) file:// url in your case is 'file:///tmp/hello.txt' And this was fine and consistent. >>> s = 'file:///tmp/hello.txt' >>> import urllib2 >>> import urllib >>> o1 = urllib.urlopen(s) >>> o2 = urllib2.urlopen(s) The extra '/' is making it in invalid url in urllib2, I think that be tracked as bug at least to show a consistent behaviour. The local file open methods of urllib2 and urllib are different. -- Senthil You may my glories and my state dispose, But not my griefs; still am I king of those. -- William Shakespeare, "Richard II" _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com