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

sudo pip freeze output is corrupted by mercurial warnings reported on stderr #1219

Closed
ogrisel opened this issue Oct 2, 2013 · 5 comments
Closed

Comments

@ogrisel
Copy link
Contributor

@ogrisel ogrisel commented Oct 2, 2013

Steps to reproduce:

  • hg clone a mercurial repo, for instance virtualkeyring with a non root user,
  • run sudo pip install -e .,
  • run sudo pip freeze.

The output of the command is corrupted as follows:

-e hg+Not trusting file /volatile/ogrisel/virtualkeyring/.hg/hgrc from untrusted user ogrisel, group ogrisel
Not trusting file /volatile/ogrisel/virtualkeyring/.hg/hgrc from untrusted user ogrisel, group ogrisel@Not trusting file /volatile/ogrisel/virtualkeyring/.hg/hgrc from untrusted user ogrisel, group ogrisel
Not trusting file /volatile/ogrisel/virtualkeyring/.hg/hgrc from untrusted user ogrisel, group ogrisel
90481d8904bfb94e63b82c86d79aa0cf6ad4ed40#egg=virtualkeyring-dev

instead of:

-e hg+http://bitbucket.org/ogrisel/virtualkeyring@90481d8904bfb94e63b82c86d79aa0cf6ad4ed40#egg=virtualkeyring-dev
@ogrisel
Copy link
Contributor Author

@ogrisel ogrisel commented Oct 2, 2013

The problem is caused by the fact that mercurial warnings reported on stderr should not be included in the parsed output of the command. This can be fixed by changing pip.util.call_process to avoid sharing the same buffer for stderr and stdout, at least for the mercurial commands.

@ogrisel
Copy link
Contributor Author

@ogrisel ogrisel commented Oct 2, 2013

This bug is causing any saltstack state that uses the pip module to fail with the following traceback:

[INFO    ] Executing command '/usr/local/bin/pip2 freeze' in directory '/volatile/ogrisel'
[ERROR   ] Can't parse line '## FIXME: could not find svn URL in dependency_links for this package:'
XXX:hg+Not trusting file /volatile/ogrisel/virtualkeyring/.hg/hgrc from untrusted user ogrisel, group ogrisel
Traceback (most recent call last):
  File "/usr/bin/salt-call", line 11, in <module>
    salt_call()
  File "/usr/lib/pymodules/python2.6/salt/scripts.py", line 76, in salt_call
    client.run()
  File "/usr/lib/pymodules/python2.6/salt/cli/__init__.py", line 265, in run
    caller.run()
  File "/usr/lib/pymodules/python2.6/salt/cli/caller.py", line 132, in run
    ret = self.call()
  File "/usr/lib/pymodules/python2.6/salt/cli/caller.py", line 73, in call
    ret['return'] = func(*args, **kwargs)
  File "/usr/lib/pymodules/python2.6/salt/modules/pip.py", line 634, in list_
    version, name = line.split('#egg=')
ValueError: need more than 1 value to unpack

@pradyunsg
Copy link
Member

@pradyunsg pradyunsg commented Sep 28, 2017

Could someone check if this is still an issue?

@cjerdonek
Copy link
Member

@cjerdonek cjerdonek commented Mar 25, 2019

I finished proposing a PR to address this issue: PR #6339. I'm hoping it can be part of the 19.1 release.

@lock
Copy link

@lock lock bot commented May 28, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the S: auto-locked label May 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators May 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants