classification
Title: subprocess.Popen etc do not accept os.PathLike in passed sequence on Windows
Type: enhancement Stage: patch review
Components: Library (Lib), Windows Versions: Python 3.8
process
Status: open Resolution: duplicate
Dependencies: Superseder: subprocess._execute_child doesn't accept a single PathLike argument for args
View: 31961
Assigned To: Nosy List: altendky, paul.moore, serhiy.storchaka, steve.dower, tim.golden, vstinner, zach.ware
Priority: normal Keywords: patch

Created on 2018-05-23 14:14 by altendky, last changed 2018-09-15 21:12 by serhiy.storchaka.

Pull Requests
URL Status Linked Edit
PR 7071 open altendky, 2018-05-23 14:32
Messages (4)
msg317408 - (view) Author: Kyle Altendorf (altendky) * Date: 2018-05-23 14:14
PS C:\Users\FSTAB\Desktop\g\20\grid-tied> py -3.6 -c "import os, pathlib, subprocess; subprocess.run([pathlib.Path()])"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Program Files\Python36\lib\subprocess.py", line 403, in run
    with Popen(*popenargs, **kwargs) as process:
  File "C:\Program Files\Python36\lib\subprocess.py", line 707, in __init__
    restore_signals, start_new_session)
  File "C:\Program Files\Python36\lib\subprocess.py", line 964, in _execute_child
    args = list2cmdline(args)
  File "C:\Program Files\Python36\lib\subprocess.py", line 461, in list2cmdline
    needquote = (" " in arg) or ("\t" in arg) or not arg
TypeError: argument of type 'WindowsPath' is not iterable


PR to follow soon.
msg317409 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-05-23 14:16
That's a feature request for Python 3.8 ;-)

> PR to follow soon.

Cool!
msg317412 - (view) Author: Kyle Altendorf (altendky) * Date: 2018-05-23 14:32
I totally failed to fill out the metadata, sorry.  I would personally consider this more of a bugfix than a feature enhancement, but I don't know how that's decided exactly.  It's also quite small.  There are a couple other open issues related to full os.PathLike protocol support.
msg325457 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-09-15 21:12
This looks like a duplicate of issue31961.
History
Date User Action Args
2018-09-15 21:12:06serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg325457
resolution: duplicate

superseder: subprocess._execute_child doesn't accept a single PathLike argument for args
2018-05-23 14:32:50altendkysetmessages: + msg317412
2018-05-23 14:32:05altendkysetkeywords: + patch
stage: patch review
pull_requests: + pull_request6700
2018-05-23 14:16:53vstinnersetstatus: closed -> open

resolution: duplicate -> (no value)

type: enhancement
stage: resolved -> (no value)
versions: + Python 3.8
nosy: + paul.moore, tim.golden, vstinner, zach.ware, steve.dower
messages: + msg317409
components: + Library (Lib), Windows
superseder: subprocess._execute_child doesn't accept a single PathLike argument for args -> (no value)
2018-05-23 14:16:13serhiy.storchakasetstatus: open -> closed
resolution: duplicate
superseder: subprocess._execute_child doesn't accept a single PathLike argument for args
stage: resolved
2018-05-23 14:14:04altendkycreate