[New-bugs-announce] [issue44224] urllib.parse.urljoin behaves differently in Python 3.9.5

rushter report at bugs.python.org
Mon May 24 06:05:10 EDT 2021


New submission from rushter <me at rushter.com>:

Since Python 3.9.5, `urllib.parse.urljoin` now strips newlines from the destination URL.

I think this should be at least mentioned in the `/Misc/NEWS.d`.

Python 3.8.10:

>>> urllib.parse.urljoin('http://a.ru', '\nsome/location')
'http://a.ru/\nsome/location'


Python 3.9.5:

>>> urllib.parse.urljoin('http://a.ru', '\nsome/location')
'http://a.ru/some/location'


We had an extra check for newlines in our Python codebase and our test started to fail.

----------
messages: 394243
nosy: rushter
priority: normal
severity: normal
status: open
title: urllib.parse.urljoin behaves differently in Python 3.9.5
type: behavior
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44224>
_______________________________________


More information about the New-bugs-announce mailing list