[2.7] bpo-36742: Fix urlparse.urlsplit() error message for Unicode URL by vstinner · Pull Request #13937 · python/cpython (original) (raw)

If urlparse.urlsplit() detects an invalid netloc according to NFKC
normalization, the error message type is now str rather than unicode,
and use repr() to format the URL, to prevent <exception str() failed>
when display the error message.

https://bugs.python.org/issue36742