diff options
author | Georg Brandl <georg@python.org> | 2013-05-12 10:08:05 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2013-05-12 10:08:05 (GMT) |
commit | 2665f218668dbf40b2bbabd4aa40b51f06fcd5f7 (patch) | |
tree | cb6537de4ab5f4efbe9ed9ed2523d2e7b25951d7 /Lib/xml | |
parent | d1ef30fa60405d55faf104f257b98c2bde4f0e45 (diff) | |
parent | 64949fa20e4845e92a1d42f581a47b559a9acd25 (diff) | |
download | cpython-2665f218668dbf40b2bbabd4aa40b51f06fcd5f7.zip cpython-2665f218668dbf40b2bbabd4aa40b51f06fcd5f7.tar.gz cpython-2665f218668dbf40b2bbabd4aa40b51f06fcd5f7.tar.bz2 |
merge with 3.3
Diffstat (limited to 'Lib/xml')
-rw-r--r-- | Lib/xml/sax/saxutils.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/xml/sax/saxutils.py b/Lib/xml/sax/saxutils.py index a62183a..0798ecd 100644 --- a/Lib/xml/sax/saxutils.py +++ b/Lib/xml/sax/saxutils.py @@ -5,6 +5,7 @@ convenience of application and driver writers. import os, urllib.parse, urllib.request import io +import codecs from . import handler from . import xmlreader @@ -77,6 +78,10 @@ def _gettextwriter(out, encoding): # use a text writer as is return out + if isinstance(out, (codecs.StreamWriter, codecs.StreamReaderWriter)): + # use a codecs stream writer as is + return out + # wrap a binary writer with TextIOWrapper if isinstance(out, io.RawIOBase): # Keep the original file open when the TextIOWrapper is |