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 · 4 comments

Comments

Projects
None yet
3 participants
@ogrisel
Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Member

commented Sep 28, 2017

Could someone check if this is still an issue?

@cjerdonek

This comment has been minimized.

Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.