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 vajrasky
Recipients berker.peksag, jaraco, vajrasky
Date 2013-09-28.09:02:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I modified the patch to handle the last case using your way as well.

Anyway, I found out that urlsplit and urlparse got the same issue as well.

>>> urlparse('', b'http://')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/sky/Code/python/programming_language/cpython/Lib/urllib/", line 292, in urlparse
    url, scheme, _coerce_result = _coerce_args(url, scheme)
  File "/home/sky/Code/python/programming_language/cpython/Lib/urllib/", line 109, in _coerce_args
    raise TypeError("Cannot mix str and non-str arguments")
TypeError: Cannot mix str and non-str arguments
>>> urlparse('', b'')
ParseResult(scheme=b'', netloc='', path='', params='', query='', fragment='')
>>> urlparse('', 0)
ParseResult(scheme=0, netloc='', path='', params='', query='', fragment='')

Same thing happens in urlsplit. Fortunately, urlunsplit and urlunparse don't have this issue.
Date User Action Args
2013-09-28 09:02:46vajraskysetrecipients: + vajrasky, jaraco, berker.peksag
2013-09-28 09:02:46vajraskysetmessageid: <>
2013-09-28 09:02:46vajraskylinkissue19094 messages
2013-09-28 09:02:46vajraskycreate