[issue27184] Support path objects in the ntpath module

2016-08-05 Thread Brett Cannon
Brett Cannon added the comment: I added support for ntpath as part of issue #27524. -- resolution: -> duplicate status: open -> closed superseder: -> Update os.path for PEP 519/__fspath__() ___ Python tracker

[issue27184] Support path objects in the ntpath module

2016-06-03 Thread Brett Cannon
Brett Cannon added the comment: os.path will be updated to work with __fspath__() as specified by Guido as part of the conversation for PEP 519 (IOW listing os.path as being updated in PEP 519 is not an accident). -- ___ Python tracker

[issue27184] Support path objects in the ntpath module

2016-06-03 Thread Ethan Furman
Ethan Furman added the comment: The expected scenario, and the purpose of os.fspath(), is to enable high-level libraries to not know or care if they receive a pathlib object or a string. In other words, they already have os.path.join() and os.path.split() calls, and currently break noisily if

[issue27184] Support path objects in the ntpath module

2016-06-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think that if some high-level function uses os.path, it likely should convert Path argument to str either because the path should be saved as a string, or for performance if multiple os.path functions are called with the same argument. Note, that some

[issue27184] Support path objects in the ntpath module

2016-06-03 Thread Ethan Furman
Ethan Furman added the comment: @Serhy: Isn't that backwards? I would think that by doing os.path first most other libraries would not have to change. -- ___ Python tracker

[issue27184] Support path objects in the ntpath module

2016-06-02 Thread Eryk Sun
Eryk Sun added the comment: Sorry, I must have missed or misunderstood something. PEP 519 discusses modifying os.path. For the os module it only discusses adding fspath and updating fsencode and fsdecode. It also discusses a new PyOS_FSPath C API, but without any discussion regarding its use

[issue27184] Support path objects in the ntpath module

2016-06-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Please don't change os.path until all other module will be changed. It may be that os.path would not need any change at all. -- ___ Python tracker

[issue27184] Support path objects in the ntpath module

2016-06-02 Thread Eryk Sun
New submission from Eryk Sun: nt is the module name for posixmodule.c on Windows, so I'm changing the title to reference ntpath instead. Regarding nt, two of its built-in functions are exposed directly in ntpath. _isdir is imported as isdir, so it needs a wrapper to support __fspath__. Only