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 elachuni
Recipients elachuni, facundobatista, georg.brandl, georg.brandl, kruegi, orsenthil, sjones
Date 2008-06-21.18:45:42
SpamBayes Score 0.0058189486
Marked as misclassified No
Message-id <1214073946.21.0.107963197076.issue754016@psf.upfronthosting.co.za>
In-reply-to
Content
I agree with facundobatista that the patch is bad, but for a different
reason: it now breaks with:

>>> import urlparse
>>> urlparse.urlparse ('http:')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/anthony/svn/python26/Lib/urlparse.py", line 108, in urlparse
tuple = urlsplit(url, scheme, allow_fragments)
  File "/home/anthony/svn/python26/Lib/urlparse.py", line 148, in urlsplit
if i > 0 and not url[i+1].isdigit():
IndexError: string index out of range

I'm afraid that it it's not evident that the expected behavior isn't
evident.

Take for example:

>>> import urlparse
>>> urlparse.urlparse('some.com', 'http')
ParseResult(scheme='http', netloc='', path='some.com', params='',
query='', fragment='')

Is the url referring to the some.com domain or to a windows executable file?

If you're using urlparse to parse only absolute urls then probably you
want the first component to be considered a net_loc, but not if you're
thinking of accepting also relative urls.

It would probably be better to be explicit and raise an exception if the
url is invalid, so that the user can prepend a '//' and resubmit if
needed.  Also we'd probably stop seeing bugreports about this issue :)
History
Date User Action Args
2008-06-21 18:45:46elachunisetspambayes_score: 0.00581895 -> 0.0058189486
recipients: + elachuni, georg.brandl, facundobatista, birkenfeld, sjones, kruegi, orsenthil
2008-06-21 18:45:46elachunisetspambayes_score: 0.00581895 -> 0.00581895
messageid: <1214073946.21.0.107963197076.issue754016@psf.upfronthosting.co.za>
2008-06-21 18:45:44elachunilinkissue754016 messages
2008-06-21 18:45:42elachunicreate