Surprising Change in Python 3.7.6

Here's a surprising change for you: Python 3.7.6 (ostensibly, a patch bugfix release) totally changed how URLs are parsed by Python programs.

As of Python 3.7.5, a URL like foo:8888 would be parsed into the following:

>>> urllib.parse.urlparse('foo:8888')
ParseResult(scheme='', netloc='', path='foo:8888', params='', query='', fragment='')

As of Python 3.7.6, foo is now detected as the scheme:

>>> urllib.parse.urlparse('foo:8888')
ParseResult(scheme='foo', netloc='', path='8888', params='', query='', fragment='')

This will cause massive chaos if you are ever parsing URLs with ports in them but without schemes. The relevant Python bug is bpo27657. I consider this to be a major regression, especially since it was introduced in a patch release.

Good luck out there...


Want to comment on this? How about we talk on Mastodon instead? mastodon logo Share on Mastodon