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: duplicate filename in exception message #76671

Closed
jwilk mannequin opened this issue Jan 3, 2018 · 5 comments
Closed

subprocess: duplicate filename in exception message #76671

jwilk mannequin opened this issue Jan 3, 2018 · 5 comments
Labels
3.7 (EOL) end of life 3.8 (EOL) end of life stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@jwilk
Copy link
Mannequin

jwilk mannequin commented Jan 3, 2018

BPO 32490
Nosy @benjaminp, @jwilk, @serhiy-storchaka, @ZackerySpytz
PRs
  • bpo-32490: Fix filename duplication in subprocess exception messages #9163
  • 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 2018-09-11.15:54:10.803>
    created_at = <Date 2018-01-03.21:34:31.553>
    labels = ['3.7', '3.8', 'type-bug', 'library']
    title = 'subprocess: duplicate filename in exception message'
    updated_at = <Date 2018-09-16.14:26:50.636>
    user = 'https://github.com/jwilk'

    bugs.python.org fields:

    activity = <Date 2018-09-16.14:26:50.636>
    actor = 'ZackerySpytz'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-09-11.15:54:10.803>
    closer = 'benjamin.peterson'
    components = ['Library (Lib)']
    creation = <Date 2018-01-03.21:34:31.553>
    creator = 'jwilk'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 32490
    keywords = ['patch']
    message_count = 5.0
    messages = ['309438', '325012', '325016', '325019', '325488']
    nosy_count = 4.0
    nosy_names = ['benjamin.peterson', 'jwilk', 'serhiy.storchaka', 'ZackerySpytz']
    pr_nums = ['9163']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue32490'
    versions = ['Python 3.6', 'Python 3.7', 'Python 3.8']

    @jwilk
    Copy link
    Mannequin Author

    jwilk mannequin commented Jan 3, 2018

    Python 3.6.4 (default, Jan  3 2018, 21:10:22) 
    [GCC 4.8.4] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import subprocess
    >>> subprocess.call('nonexistent')
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/local/lib/python3.6/subprocess.py", line 267, in call
        with Popen(*popenargs, **kwargs) as p:
      File "/usr/local/lib/python3.6/subprocess.py", line 709, in __init__
        restore_signals, start_new_session)
      File "/usr/local/lib/python3.6/subprocess.py", line 1344, in _execute_child
        raise child_exception_type(errno_num, err_msg, err_filename)
    FileNotFoundError: [Errno 2] No such file or directory: 'nonexistent': 'nonexistent'

    Note that the name of the missing file is mentioned twice in the error message.
    (Strictly speaking it's once in the message, and once in the filename attribute, but for a casual observer, the effect is the same.)

    @jwilk jwilk mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Jan 3, 2018
    @ZackerySpytz ZackerySpytz mannequin added 3.7 (EOL) end of life 3.8 (EOL) end of life labels Sep 11, 2018
    @serhiy-storchaka
    Copy link
    Member

    This code was added in bpo-4925. Is the original problem gone?

    @benjaminp
    Copy link
    Contributor

    The builtin exception is better now, so I don't see a problem with reverting the original patch.

    @benjaminp
    Copy link
    Contributor

    New changeset 73870bf by Benjamin Peterson (Zackery Spytz) in branch 'master':
    closes bpo-32490: Fix filename duplication in subprocess exception message. (GH-9163)
    73870bf

    @ZackerySpytz
    Copy link
    Mannequin

    ZackerySpytz mannequin commented Sep 16, 2018

    There was also some relevant discussion in bpo-22536.

    @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.7 (EOL) end of life 3.8 (EOL) end of life stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants