This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Python3.4: xml.sax.saxutils.XMLGenerator.__init__ fails with pythonw.exe
Type: crash Stage:
Components: Library (Lib) Versions: Python 3.4
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Edward.K..Ream, r.david.murray, serhiy.storchaka
Priority: normal Keywords:

Created on 2014-11-08 11:17 by Edward.K..Ream, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (4)
msg230844 - (view) Author: Edward K. Ream (Edward.K..Ream) Date: 2014-11-08 11:17
In Python3.2 xml.sax.saxutils.XMLGenerator.__init__ succeeds if the "out" keyword argument is not given and sys.stdout is None, which will typically be the case when using pythonw.exe.

Alas, on Python3.4, the ctor throws an exception in this case.

This is a major compatibility issue, and is completely unnecessary: the ctor should work as before.  An easy fix: allocate a file-like object as the out stream, or just do what is done in Python 3.2 ;-)
msg230847 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-11-08 12:03
In any case XMLGenerator is not usable if the "out" keyword argument is not given and sys.stdout is None. Just the exception will be raised later. I consider early failure as a feature, not a bug.
msg230852 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014-11-08 12:41
Agreed.  I was going to ask what it was that 3.2 did that was useful.
msg230854 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-11-08 12:56
FYI the code was changed in issue1470548.
History
Date User Action Args
2022-04-11 14:58:09adminsetgithub: 67008
2015-02-10 08:45:41serhiy.storchakasetstatus: pending -> closed
resolution: not a bug
2014-11-27 19:46:14serhiy.storchakasetstatus: open -> pending
2014-11-08 12:56:14serhiy.storchakasetmessages: + msg230854
2014-11-08 12:41:48r.david.murraysetnosy: + r.david.murray
messages: + msg230852
2014-11-08 12:03:01serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg230847
2014-11-08 11:17:10Edward.K..Reamcreate