[issue23551] IDLE to provide menu link to PIP gui.

Terry J. Reedy report at bugs.python.org
Wed Jan 13 04:01:52 EST 2016


Terry J. Reedy added the comment:

On python-list, Chris Angelico reported 2 other problems when running something like "import pip; pip.main(['install','psycopg2'])" from IDLE.  Both can be worked around in a pipgui program.

1. pip displays a progress bar by sending to stdout a sequence of strings something like '#', '\r##', '\r###', ..., '\r###...###'.  When IDLE sends these on to the tk text widget, they are displayed as above.  '\r' displays as '\r' and does not cause a 'return'.

pipgui would already be monitoring and parsing pip output to display information in appropriate widgets, so it could look for and interpret whatever pip actually does send.

2. pip has a bug.  When installing a non-wheel, it may unconditionally execute "s.decode(sys.__stdout__.encoding)".  sys.__stdin__, etcetera, are documented as sometimes being None, https://docs.python.org/3/library/sys.html#sys.__stdin__, and None does not have an 'encoding' attribute.  The workaround, until this is fixed, is for pipgui to rebind sys.__stdout__ to an object that at least has a sensible .encoding.  I would grep the entire pip source other '__std.*__' uses to see if more is needed.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23551>
_______________________________________


More information about the Python-bugs-list mailing list