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.

classification
Title: urllib.parse.urljoin behaves differently in Python 3.9.5
Type: behavior Stage: resolved
Components: Versions: Python 3.9
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: rushter
Priority: normal Keywords:

Created on 2021-05-24 10:05 by rushter, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (2)
msg394243 - (view) Author: (rushter) Date: 2021-05-24 10:05
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.
msg394244 - (view) Author: (rushter) Date: 2021-05-24 10:13
Sorry, I found the commit that mentions this https://github.com/python/cpython/commit/0593ae84af9e0e8332644e7ed13d7fd8306c4e1a

It's not live on Python.org though.
History
Date User Action Args
2022-04-11 14:59:46adminsetgithub: 88390
2021-05-24 10:13:53rushtersetstatus: open -> closed

messages: + msg394244
stage: resolved
2021-05-24 10:05:10rushtercreate