question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pip config and $EDITOR containing arguments

See original GitHub issue

Environment

  • pip version: 19.2.3
  • Python version: 3.8
  • OS: Linux

Description

pip config edit is supposed to open the program specified by environment variable Editor if it’s set. Actually if the env is a program with its options, pip will treat the whole thing as the program name and throws a FileNotFoundError.

Expected behavior

pip config edit open the editor with options set.

How to Reproduce

  1. export EDITOR="nvim --noplugin"; pip config edit

Output

ERROR: Exception:
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 188, in main
    status = self.run(options, args)
  File "/usr/lib/python3.8/site-packages/pip/_internal/commands/configuration.py", line 136, in run
    handlers[action](options, args[1:])
  File "/usr/lib/python3.8/site-packages/pip/_internal/commands/configuration.py", line 216, in open_in_editor
    subprocess.check_call([editor, fname])
  File "/usr/lib/python3.8/subprocess.py", line 359, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib/python3.8/subprocess.py", line 340, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib/python3.8/subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'nvim  #--noplugin'

My Fix #7391

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:26 (22 by maintainers)

github_iconTop GitHub Comments

3reactions
uranusjrcommented, Sep 10, 2020

I feel we should yield and just use shell=True if needed. I still think it’s wrong, but it is what users expect because everybody is doing it.

2reactions
chrahuntcommented, Jul 14, 2020

On Windows it would also need to check PATHEXT. And we’d need tests for the same. Given that, I would no longer implement this for Python 2. We can just use the existing behavior for Python 2 and handle args in Python 3.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pip config - pip documentation v22.3.1
list: List the active configuration (or from the file specified). edit: Edit the configuration file in an editor. get: Get the value associated...
Read more >
Updating the pip.conf file to use https - Stack Overflow
I have reinstalled pypi few times on few servers with Ubuntu 12.04 and all was working well without problems. pip is a tool...
Read more >
pip Documentation - Read the Docs
Logically, a Requirements file is just a list of pip install arguments placed in a file. Note that you should not rely on....
Read more >
User Guide — pip 8.1.1 documentation
pip allows you to set all command line option defaults in a standard ini style config file. The names and locations of the...
Read more >
config-argument-parser - PyPI
A package help automatically create command-line interface from configuration or code. It contains two modules CAP ( ConfigArgumentParser ) and TAP ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found