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
os_path.diff: Tests and fixes not involving stat or lstat
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='https://github.com/brettcannon'closed_at=<Date2016-08-26.21:46:15.496>created_at=<Date2016-07-15.21:06:32.888>labels= ['type-bug', 'library', 'release-blocker']
title='Update os.path for PEP 519/__fspath__()'updated_at=<Date2016-09-06.22:59:12.300>user='https://github.com/brettcannon'
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.
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).
Activity
brettcannon commentedon Jul 15, 2016
As per PEP-519, os.path needs to be updated to support __fspath__().
brettcannon commentedon Jul 15, 2016
Here are tests for genericpath, posixpath, and ntpath (which should in the end cover all of os.path).
brettcannon commentedon Jul 29, 2016
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.
brettcannon commentedon Jul 29, 2016
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).
python-dev commentedon Aug 26, 2016
New changeset b64f83d6ff24 by Brett Cannon in branch 'default':
Issue bpo-26027, bpo-27524: Add PEP 519/fspath() support to os and
https://hg.python.org/cpython/rev/b64f83d6ff24
python-dev commentedon Sep 6, 2016
New changeset 9be0286772bf by Brett Cannon in branch 'default':
Issue bpo-26027, bpo-27524: Document the support for path-like objects in os and os.path.
https://hg.python.org/cpython/rev/9be0286772bf