Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
altendky mannequin opened this issue May 23, 2018 · 4 comments
Closed

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

altendky mannequin opened this issue May 23, 2018 · 4 comments
Labels
3.8 only security fixes OS-windows stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@altendky
Copy link
Mannequin

altendky mannequin commented May 23, 2018

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']

    @altendky
    Copy link
    Mannequin Author

    altendky mannequin commented May 23, 2018

    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.

    @vstinner
    Copy link
    Member

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

    PR to follow soon.

    Cool!

    @vstinner vstinner added 3.8 only security fixes stdlib Python modules in the Lib dir OS-windows labels May 23, 2018
    @vstinner vstinner reopened this May 23, 2018
    @vstinner vstinner added the type-feature A feature request or enhancement label May 23, 2018
    @altendky
    Copy link
    Mannequin Author

    altendky mannequin commented May 23, 2018

    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.

    @serhiy-storchaka
    Copy link
    Member

    This looks like a duplicate of bpo-31961.

    @zooba zooba closed this as completed Aug 2, 2019
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes OS-windows stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants