[issue4997] xml.sax.saxutils.XMLGenerator should write to io.RawIOBase.

2012-07-15 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

This issue will be fixed by patch for issue1470548.

--
nosy: +storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4997] xml.sax.saxutils.XMLGenerator should write to io.RawIOBase.

2012-08-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> duplicate
superseder:  -> Bugfix for #1470540 (XMLGenerator cannot output UTF-16)

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4997] xml.sax.saxutils.XMLGenerator should write to io.RawIOBase.

2009-01-19 Thread HiroakiKawai

New submission from HiroakiKawai :

xml.sax.saxutils.XMLGenerator._write tests the argument by 
isinstance(text, str), but this is problematic in Python 3.0. 
XMLGenerator accepts encoding and the produced file is encoded by that 
encoding, i.e., the XML is a binary sequence. So IMHO, the XMLGenerator 
constructor argument should be a subclass of io.RawIOBase.

--
components: Library (Lib), XML
messages: 80155
nosy: kawai
severity: normal
status: open
title: xml.sax.saxutils.XMLGenerator should write to io.RawIOBase.
versions: Python 3.0

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4997] xml.sax.saxutils.XMLGenerator should write to io.RawIOBase.

2012-10-24 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4997] xml.sax.saxutils.XMLGenerator should write to io.RawIOBase.

2009-07-22 Thread Craig Holmquist

Craig Holmquist  added the comment:

To clarify the specific problem:

- If the file object passed to XMLGenerator is opened in binary mode,
XMLGenerator raises TypeError as soon as it tries to write to it
- If the passed file object is opened in text mode, XMLGenerator writes
the prescribed encoding to the XML declaration but it actually uses the
file object's encoding when writing everything

--
nosy: +craigh

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4997] xml.sax.saxutils.XMLGenerator should write to io.RawIOBase.

2009-07-22 Thread Craig Holmquist

Craig Holmquist  added the comment:

Patch attached.  This patch doesn't actually restrict the output object
to RawIOBase (that wouldn't work well, since files opened as binary are
actually derived from BufferedIOBase).  Instead, it just assumes the
output object has a 'write' method that accepts a single bytes argument.
 Also, XMLGenerator no longer needs to check if the input is str or unicode.

--
keywords: +patch
Added file: http://bugs.python.org/file14541/xmlgen.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4997] xml.sax.saxutils.XMLGenerator should write to io.RawIOBase.

2009-07-22 Thread Craig Holmquist

Craig Holmquist  added the comment:

Actually, that patch may not work so well either... out defaults to
sys.stdout, but that can't accept bytes.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com




[issue4997] xml.sax.saxutils.XMLGenerator should write to io.RawIOBase.

2009-07-22 Thread Craig Holmquist

Craig Holmquist  added the comment:

This new patch removes the "default to stdout" behavior.

--
Added file: http://bugs.python.org/file14544/xmlgen2.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4997] xml.sax.saxutils.XMLGenerator should write to io.RawIOBase.

2009-07-22 Thread Craig Holmquist

Craig Holmquist  added the comment:

Patch for documentation.

--
Added file: http://bugs.python.org/file14545/xmlgen-doc.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4997] xml.sax.saxutils.XMLGenerator should write to io.RawIOBase.

2009-07-22 Thread Craig Holmquist

Changes by Craig Holmquist :


Removed file: http://bugs.python.org/file14541/xmlgen.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4997] xml.sax.saxutils.XMLGenerator should write to io.RawIOBase.

2009-08-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

You shouldn't remove the defaulting behaviour for `out`, but use
`sys.stdout.buffer` instead.

Bonus points if you add a test so that this kind of bug doesn't go
unnoticed again.

PS: it's ironic that the default encoding here is iso-8859-1. This piece
of code is really getting old.

--
nosy: +pitrou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com