[New-bugs-announce] [issue38670] can we accept os.PathLike objects within the subprocess args= list?

Gregory P. Smith report at bugs.python.org
Sun Nov 3 03:13:12 EST 2019


New submission from Gregory P. Smith <greg at krypto.org>:

We started down this path in https://bugs.python.org/issue31961 but had to revert part of that before 3.7 as the implementation was incomplete making it inconsistent across platforms.  https://github.com/python/cpython/pull/4329.

Specifically accepting PathLike objects within the args list hasn't been ruled out...

There is at least one question about behavior though, is str() called when running on posix systems or bytes() (bytes uses fsencode)?

Or does what gets called depend on the specific sub-type of the path vs the current platform?

Example scenario: if you're processing a PureWindowsPath on a posix system and passing that to a child process, sending that through os.fsencode would presumably be the wrong choice...

----------
messages: 355890
nosy: gregory.p.smith
priority: normal
severity: normal
stage: needs patch
status: open
title: can we accept os.PathLike objects within the subprocess args= list?
type: enhancement
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38670>
_______________________________________


More information about the New-bugs-announce mailing list