Closed
Description
Description
If you run pip config --edit
with an editor that doesn't exist, pip presents a traceback.
Expected behavior
pip
would present a clear error message, about which file could not be found.
pip version
21.3.1
Python version
N/A
OS
Windows
How to Reproduce
Run pip config edit --editor code
on a Windows machine without VSCode installed.
Output
C:\Users\traveler\Desktop\pip>py -m pip config edit --editor code
ERROR: Exception:
Traceback (most recent call last):
File "C:\Users\traveler\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\cli\base_command.py", line 173, in _main
status = self.run(options, args)
File "C:\Users\traveler\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\commands\configuration.py", line 128, in run
handlers[action](options, args[1:])
File "C:\Users\traveler\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\commands\configuration.py", line 225, in open_in_editor
subprocess.check_call([editor, fname])
File "C:\Users\traveler\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 364, in check_call
retcode = call(*popenargs, **kwargs)
File "C:\Users\traveler\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 345, in call
with Popen(*popenargs, **kwargs) as p:
File "C:\Users\traveler\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 966, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\traveler\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 1435, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
Code of Conduct
- I agree to follow the PSF Code of Conduct.