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.

Author albert
Recipients albert
Date 2009-08-03.13:33:01
SpamBayes Score 7.76361e-05
Marked as misclassified No
Message-id <1249306383.87.0.829314243328.issue6631@psf.upfronthosting.co.za>
In-reply-to
Content
The functions urlparse.url{,un}split() and urllib{,2}.open() do not work 
together for relative, local files, due a bug in urlunsplit.

Given a file f='./rel/path/to/file.html' it can be open directly by 
urllib.open(f), but not in urllib2! as the later needs a scheme.
We can create a sound url with spilt/unspilt and a default scheme:
f2=urlparse.urlunsplit(urlparse.urlsplit(f,'file')); which works most 
cases, HOWEVER a bogus netloc is added for relative filepaths.

If have isolated this  "buggy" function, added some local testcode and 
made patch/workaround in my file 'unsplit.py' Which is included. Hope 
this will contribute to a real patch.


--Groetjes, Albert

ALbert Mietus
                                                Don't send spam mail!
Mijn missie: http://SoftwareBeterMaken.nl      product, proces & imago.
Mijn leven in het kort:        
http://albert.mietus.nl/Doc/CV_ALbert.html
History
Date User Action Args
2009-08-03 13:33:03albertsetrecipients: + albert
2009-08-03 13:33:03albertsetmessageid: <1249306383.87.0.829314243328.issue6631@psf.upfronthosting.co.za>
2009-08-03 13:33:02albertlinkissue6631 messages
2009-08-03 13:33:02albertcreate