merge with 3.3

This commit is contained in:
Georg Brandl 2013-05-12 12:08:05 +02:00
commit 2665f21866
3 changed files with 45 additions and 0 deletions

View file

@ -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