You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorrect behaviour for user@password URI pattern in urlparse #81859
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=Nonecreated_at=<Date2019-07-25.09:49:26.624>labels= ['3.7', 'type-bug', 'library']
title='Incorrect behaviour for user@password URI pattern in urlparse'updated_at=<Date2019-07-29.03:30:11.402>user='https://github.com/truebit'
I tried your example and I think urlparse's behavior is correct.
From the RFC 1738:
Octets must be encoded if they have no corresponding graphic
character within the US-ASCII coded character set, if the use of the
corresponding character is unsafe, or if the corresponding character
is reserved for some other interpretation within the particular URL
scheme.
Part of the password is parsed as the URL fragment because the character # has a special meaning:
The character "#" is unsafe and should
always be encoded because it is used in World Wide Web and in other
systems to delimit a URL from a fragment/anchor identifier that might
follow it.
Activity
truebit commentedon Jul 25, 2019
When an IPV4 URL with 'username:password' in it, and the password contains special characters like #[]?, urlparse would act as unexcepted.
example:
potomak commentedon Jul 29, 2019
What do you mean that urlparse act as unexpected?
I tried your example and I think urlparse's behavior is correct.
From the RFC 1738:
Your example:
Part of the password is parsed as the URL fragment because the character
#has a special meaning:saito828koki commentedon Oct 5, 2022
This is not a bug. This issue can be closed.
davidism commentedon Jan 31, 2024
@serhiy-storchaka this is the same invalid issue as #110869 which you just closed. This can be closed as well.