This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients miss-islington, ned.deily, ronaldoussoren, serhiy.storchaka, tony.diloreto
Date 2021-02-08.17:07:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1612804034.26.0.338176525127.issue41754@roundup.psfhosted.org>
In-reply-to
Content
Is it possible that your PATH contains a non-directory? Because it can give results a NotADirectoryError:

>>> subprocess.check_output(['xdg-settings', 'get', 'default-web-browser'], env={'PATH': '/etc/hosts'})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/serhiy/py/cpython/Lib/subprocess.py", line 429, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/home/serhiy/py/cpython/Lib/subprocess.py", line 510, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/home/serhiy/py/cpython/Lib/subprocess.py", line 962, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/home/serhiy/py/cpython/Lib/subprocess.py", line 1840, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
NotADirectoryError: [Errno 20] Not a directory: 'xdg-settings'

Reopened because I afraid that there may be a severe configuration error hidden by silencing NotADirectoryError.

Could you please show os.environ['PATH'] on your computer?
History
Date User Action Args
2021-02-08 17:07:14serhiy.storchakasetrecipients: + serhiy.storchaka, ronaldoussoren, ned.deily, miss-islington, tony.diloreto
2021-02-08 17:07:14serhiy.storchakasetmessageid: <1612804034.26.0.338176525127.issue41754@roundup.psfhosted.org>
2021-02-08 17:07:14serhiy.storchakalinkissue41754 messages
2021-02-08 17:07:13serhiy.storchakacreate