Skip to content

subprocess.Popen etc do not accept os.PathLike in passed sequence on Windows #77798

Closed

Description

@altendky
mannequin
BPO 33617
Nosy @pfmoore, @vstinner, @tjguk, @zware, @serhiy-storchaka, @zooba, @altendky
PRs
  • bpo-33617: Use os.fspath() for subprocess sequences on Windows #7071
  • Superseder
  • bpo-31961: subprocess._execute_child doesn't accept a single PathLike argument for args
  • 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 = None
    closed_at = <Date 2019-08-02.22:39:40.618>
    created_at = <Date 2018-05-23.14:14:04.178>
    labels = ['3.8', 'type-feature', 'library', 'OS-windows']
    title = 'subprocess.Popen etc do not accept os.PathLike in passed sequence on Windows'
    updated_at = <Date 2019-08-02.22:39:40.618>
    user = 'https://github.com/altendky'

    bugs.python.org fields:

    activity = <Date 2019-08-02.22:39:40.618>
    actor = 'steve.dower'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-08-02.22:39:40.618>
    closer = 'steve.dower'
    components = ['Library (Lib)', 'Windows']
    creation = <Date 2018-05-23.14:14:04.178>
    creator = 'altendky'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 33617
    keywords = ['patch']
    message_count = 4.0
    messages = ['317408', '317409', '317412', '325457']
    nosy_count = 7.0
    nosy_names = ['paul.moore', 'vstinner', 'tim.golden', 'zach.ware', 'serhiy.storchaka', 'steve.dower', 'altendky']
    pr_nums = ['7071']
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '31961'
    type = 'enhancement'
    url = 'https://bugs.python.org/issue33617'
    versions = ['Python 3.8']

    Activity

    1. altendky commented on May 23, 2018

      altendkymannequin
      MannequinAuthor
      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.

    2. vstinner commented on May 23, 2018

      @vstinner
      Member

      That's a feature request for Python 3.8 ;-)

      PR to follow soon.

      Cool!

    3. added
      3.8 (EOL)
      stdlib
      on May 23, 2018
    4. added
      type-feature
      on May 23, 2018
    5. altendky commented on May 23, 2018

      altendkymannequin
      MannequinAuthor

      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.

    6. serhiy-storchaka commented on Sep 15, 2018

      @serhiy-storchaka
      Member

      This looks like a duplicate of bpo-31961.

    7. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.8 (EOL)OS-windowsstdlibtype-feature

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions