0

From the docs:

Under some conditions stdin, stdout and stderr as well as the original values stdin, stdout and stderr can be None. It is usually the case for Windows GUI apps that aren’t connected to a console and Python apps started with pythonw.

  • Why would a standard stream be set to None?
  • What are the consequences of standard in/out being None?
  • Where is the relevant code or docs explaining these consequences?
Hatshepsut
  • 5,962
  • 8
  • 44
  • 80
  • It's unclear to me what else you want to know. 1. Because it isn't connected to a console. 2. As a consequence any code that assumes that those values aren't None will likely crash (although print will be fine: https://stackoverflow.com/a/49757760/3001761). 3. You've quoted the docs; what code are you looking for? – jonrsharpe Jan 27 '19 at 23:27
  • 1
    @jonrsharpe Thanks for the link. That answer and comment seems to be what I want. Especially "The fact that sys.stdout may be None is documented; as far as I can tell, the behavior of print when it encounters None for sys.stdout is not" – Hatshepsut Jan 28 '19 at 00:03

0 Answers0