[issue41546] pprint() gives exception when ran from pythonw

2021-07-19 Thread Irit Katriel
Change by Irit Katriel : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue41546] pprint() gives exception when ran from pythonw

2021-07-19 Thread Irit Katriel
Irit Katriel added the comment: New changeset aab1899c9d79083c1ff31d974ed8b562d3ca3b5d by Irit Katriel in branch 'main': bpo-41546: make pprint (like print) not write to stdout when it is None (GH-26810) https://github.com/python/cpython/commit/aab1899c9d79083c1ff31d974ed8b562d3ca3b5d

[issue41546] pprint() gives exception when ran from pythonw

2021-06-20 Thread Irit Katriel
Change by Irit Katriel : -- versions: +Python 3.11 -Python 3.10 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue41546] pprint() gives exception when ran from pythonw

2021-06-20 Thread Irit Katriel
Change by Irit Katriel : -- keywords: +patch nosy: +iritkatriel nosy_count: 9.0 -> 10.0 pull_requests: +25392 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26810 ___ Python tracker

[issue41546] pprint() gives exception when ran from pythonw

2020-08-17 Thread Steve Dower
Steve Dower added the comment: I'm inclined to agree that it should pass silently in this case, as if it were printing with print() rather than .write(). What better meaning is there for sys.stdout == None than "no output"? -- versions: +Python 3.10 -Python 3.8 _

[issue41546] pprint() gives exception when ran from pythonw

2020-08-17 Thread Vedran Čačić
Vedran Čačić added the comment: The big part of the justification for making print a function in Py3 is that it can be painlessly replaced with other functions, such as (example given by BDFL) pprint.pprint. I think we should do what we can to make the replacement as painless as possible. --

[issue41546] pprint() gives exception when ran from pythonw

2020-08-15 Thread Henrique Gj
Henrique Gj added the comment: > Debug prints should not crash a program. > 'Not a bug' wait -- nosy: +henriquesdj0 ___ Python tracker ___ __

[issue41546] pprint() gives exception when ran from pythonw

2020-08-14 Thread Terry J. Reedy
Terry J. Reedy added the comment: If you run in windowed mode, you are expected to either not use sys.stdout or to provide a working sys.stdout object. I am not sure if that is explicitly documented as I cannot find python.exe and pythonw.exe or .py or .pyw in the index and https://docs.pyt

[issue41546] pprint() gives exception when ran from pythonw

2020-08-14 Thread Luiz
Luiz added the comment: If this is normal behavior, then why does print() not produce any error? Shouldn't it say that it can't print because there's no stdout? That's not very consistent, both functions have almost the same name yet produce very different results. -- _

[issue41546] pprint() gives exception when ran from pythonw

2020-08-14 Thread Steve Dower
Steve Dower added the comment: This is normal, if obscure, behaviour. Pythonw starts without a console, and so stdout is not connected to anything. As a result, you can't print (or pprint). You'll need to set sys.stdout to something or provide a file if you want to print output. If someone

[issue41546] pprint() gives exception when ran from pythonw

2020-08-14 Thread Luiz
Luiz added the comment: I'm on Windows 7. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue41546] pprint() gives exception when ran from pythonw

2020-08-14 Thread Ned Deily
Ned Deily added the comment: Thanks for the report. Just to be clear, this is running on Windows? And, if so, which version? -- components: +Windows nosy: +ned.deily, paul.moore, steve.dower, tim.golden, zach.ware ___ Python tracker

[issue41546] pprint() gives exception when ran from pythonw

2020-08-13 Thread Luiz
New submission from Luiz : If you use the pprint function when running on windowed mode (either by using the .pyw extension or running the file with pythonw) a "AttributeError" exception occurs, saying that "'NoneType' object has no attribute 'write'". Looking at the source code (Lib/pprint.p