Issue 27524: Update os.path for PEP 519/fspath() (original) (raw)

Issue27524

Created on 2016-07-15 21:06 by brett.cannon, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
fspath_tests.diff brett.cannon,2016-07-15 22:53 review
os_path.diff brett.cannon,2016-07-29 22:29 Tests and fixes not involving stat or lstat review
Messages (6)
msg270513 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2016-07-15 21:06
As per PEP 519, os.path needs to be updated to support __fspath__().
msg270519 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2016-07-15 22:53
Here are tests for genericpath, posixpath, and ntpath (which should in the end cover all of os.path).
msg271645 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2016-07-29 20:04
Ran into the first nasty snag: people are abusing os.path.commonprefix() and it's extremely generic approach. Instead of passing in a list of file paths they are passing a list of lists of file path *parts*, e.g. instead of ["a/b", "a/c"] they are passing in [["a", "b"], ["a", "c"]]. I have special-cased when the list contains another list or tuple, but I still feel dirty doing it.
msg271654 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2016-07-29 22:29
Here is a patch that includes the previous tests as long with fixes which don't involve stat or lstat (once those functions are updated themselves then os.path will be ported).
msg273733 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-08-26 21:45
New changeset b64f83d6ff24 by Brett Cannon in branch 'default': Issue #26027, #27524: Add PEP 519/__fspath__() support to os and https://hg.python.org/cpython/rev/b64f83d6ff24
msg274655 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-09-06 22:59
New changeset 9be0286772bf by Brett Cannon in branch 'default': Issue #26027, #27524: Document the support for path-like objects in os and os.path. https://hg.python.org/cpython/rev/9be0286772bf
History
Date User Action Args
2022-04-11 14:58:33 admin set github: 71711
2016-09-06 22:59:12 python-dev set messages: +
2016-08-26 21:46:15 brett.cannon set status: open -> closedresolution: fixedstage: needs patch -> resolved
2016-08-26 21:45:25 python-dev set nosy: + ned.deily, python-devmessages: +
2016-08-05 19:44:45 brett.cannon link issue27184 superseder
2016-07-29 22:29:23 brett.cannon set files: + os_path.diffmessages: +
2016-07-29 20:04:40 brett.cannon set messages: +
2016-07-15 22:53:13 brett.cannon set files: + fspath_tests.diffkeywords: + patchmessages: + stage: test needed -> needs patch
2016-07-15 22:00:51 ethan.furman set nosy: + ethan.furman
2016-07-15 21:06:56 brett.cannon set dependencies: + Support Path objects in the posix module, Support path objects in the ntpath module
2016-07-15 21:06:32 brett.cannon create