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.request.HTTPPasswordMgr.is_suburi does not care about order
Type: Stage:
Components: Library (Lib) Versions:
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Fongeme, cheryl.sabella, orsenthil, terry.reedy
Priority: normal Keywords:

Created on 2021-01-09 21:23 by Fongeme, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 24181 closed Fongeme, 2021-01-09 21:23
Messages (4)
msg384741 - (view) Author: Yair Frid (Fongeme) * Date: 2021-01-09 21:23
In docs, it mentions that the function returns true if the base is a 'suburi' of test, but in reality, if is_suburi(base, test) then is_suburi(test, base) which is wrong in most cases (other than where base ~= test, meaning they are the same location)
I am unsure which versions of python are affected, but i suspect most of them (although we probably shouldn't backport this fix?)
msg384790 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2021-01-11 00:28
Cheryl, do you have time to review this?
msg397057 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2021-07-06 22:00
Yair, is this really a separate bug from that reported in #42766?  In other words, are there separate and distinct failing test cases?  If not, this should be closed as a duplicate.
msg397064 - (view) Author: Yair Frid (Fongeme) * Date: 2021-07-07 05:55
This issue was discovered when i was writing unit tests for #42766, since #42766 was fixed when i discovered it, i realized i might want a new issue, i don't mind moving this to be a comment, but there *are* 2 distinct test cases that fail:

a test case that would fail here:
is_suburi('/foo/bar', '/bar/foo') == True
which is different than;
is_suburi('/foo/bar', '/foobar') == True
History
Date User Action Args
2022-04-11 14:59:40adminsetgithub: 87044
2021-07-07 14:02:17gvanrossumsetnosy: - gvanrossum
2021-07-07 05:55:04Fongemesetmessages: + msg397064
2021-07-06 22:00:04terry.reedysetnosy: + terry.reedy, orsenthil
messages: + msg397057
2021-01-11 00:28:44gvanrossumsetnosy: + gvanrossum, cheryl.sabella
messages: + msg384790
2021-01-09 21:23:37Fongemecreate