[issue22730] ensurepip should work with pythonw.exe

2014-10-26 Thread Steve Dower
New submission from Steve Dower: I'd like to be able to run ensurepip in the 3.5 installer with pythonw.exe, to avoid having the console window appear. Unfortunately, pip requires a valid value for sys.__stdout__. This patch adds a dummy value for __stdout__ that allows pip to be

[issue22730] ensurepip should work with pythonw.exe

2014-10-26 Thread Donald Stufft
Donald Stufft added the comment: This looks OK to me. I'm not a Windows person are there changes in pip that would make sense to make it work without this patch? -- nosy: +Marcus.Smith, pmoore ___ Python tracker rep...@bugs.python.org

[issue22730] ensurepip should work with pythonw.exe

2014-10-26 Thread Steve Dower
Steve Dower added the comment: I think the only thing pip could do is to stop using print(), which is not a reasonable request. It may be reasonable to change pythonw to use dummy IO streams by default, but that may cause programs to print() messages expecting the user to see them. It's also

[issue22730] ensurepip should work with pythonw.exe

2014-10-26 Thread Donald Stufft
Donald Stufft added the comment: The development version of pip switches things over to using the Python logging framework instead of a homegrown one which more or less relies on print(). Probably we could detect if we don't have a stdout and just not output anything? People can pass a

[issue22730] ensurepip should work with pythonw.exe

2014-10-26 Thread Steve Dower
Steve Dower added the comment: That change sounds like it'll be enough, and I'd be surprised if the logging module doesn't already handle the case with no streams. (Aside: it'd be nice for ensurepip to have a log file parameter that can be passed through.) I'll hold off on merging this in

[issue22730] ensurepip should work with pythonw.exe

2014-10-26 Thread Paul Moore
Paul Moore added the comment: This looks reasonable to me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22730 ___ ___ Python-bugs-list mailing

[issue22730] ensurepip should work with pythonw.exe

2014-10-26 Thread Paul Moore
Paul Moore added the comment: Wait, sorry I misread the discussion (long day here). If we can do this in pip yes that would be better. It looks like we can detect when we're being run via pythonw by checking if sys.stdout is None. -- ___ Python