
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2016-12-26 20:46 byGeorg Mischler, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 552 | closed | dstufft,2017-03-31 16:36 | |
| Messages (5) | |||
|---|---|---|---|
| msg284045 -(view) | Author: Georg Mischler (Georg Mischler) | Date: 2016-12-26 20:46 | |
When pathlib.resolve() is invoked on Windows(10) with an absolute path including a non-existing drive, it gets caught in an infinite loop.To reproduce:Select a drive letter that doesn't exist on the system (in my case H:).Run the following line of code: pathlib.Path('h:\\').resolve()Expected result:returns the input string unchanged.Actual result:pathlib.resolve() ends up in an infinite loop, repeatedly calling _getfinalpathname() on the same string. | |||
| msg284048 -(view) | Author: Steve Dower (steve.dower)*![]() | Date: 2016-12-26 21:41 | |
We should break out of the "while True" loop in _WindowsFlavour.resolve when joining with ".." doesn't result in a different path. | |||
| msg284217 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2016-12-29 00:03 | |
New changesetaf8c8551ea45 by Steve Dower in branch '3.6':Issue#29079: Prevent infinite loop in pathlib.resolve() on Windowshttps://hg.python.org/cpython/rev/af8c8551ea45New changeset9de7bf6c60d2 by Steve Dower in branch 'default':Issue#29079: Prevent infinite loop in pathlib.resolve() on Windowshttps://hg.python.org/cpython/rev/9de7bf6c60d2 | |||
| msg286760 -(view) | Author: Serhiy Storchaka (serhiy.storchaka)*![]() | Date: 2017-02-02 10:21 | |
I'm not sure the fix is correct. os.path.dirname(s) can point to different place than os.path.abspath(os.path.join(s, os.pardir)) if the last component of s is "..", "." or a symbolic link.Would be nice to add tests. | |||
| msg286806 -(view) | Author: Steve Dower (steve.dower)*![]() | Date: 2017-02-02 16:30 | |
At the point this code is running, it doesn't matter. The path doesn't exist, so trimming irrelevant segments from it will just cause a few extra iterations through resolve until we clear out enough of the absent segments to find something that does exist.abspath just prepends the current working directory unless the path is rooted, so we essentially have unbounded concatenation of "\.." in that case. | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:41 | admin | set | github: 73265 |
| 2017-03-31 16:36:34 | dstufft | set | pull_requests: +pull_request1070 |
| 2017-02-02 16:30:53 | steve.dower | set | messages: +msg286806 |
| 2017-02-02 10:21:11 | serhiy.storchaka | set | nosy: +serhiy.storchaka messages: +msg286760 |
| 2016-12-29 00:04:11 | steve.dower | set | status: open -> closed assignee:steve.dower resolution: fixed stage: needs patch -> resolved |
| 2016-12-29 00:03:58 | python-dev | set | nosy: +python-dev messages: +msg284217 |
| 2016-12-26 21:41:08 | steve.dower | set | stage: needs patch |
| 2016-12-26 21:41:00 | steve.dower | set | messages: +msg284048 |
| 2016-12-26 21:02:29 | serhiy.storchaka | set | nosy: +pitrou |
| 2016-12-26 20:46:14 | Georg Mischler | create | |