From: Armin Ronacher Date: Sat, 18 May 2013 10:46:35 +0000 (+0100) Subject: Make dump() work Python 3.3 X-Git-Tag: 2.7~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58d458dd62cf61374f621322f984cf149b324e56;p=thirdparty%2Fjinja.git Make dump() work Python 3.3 --- diff --git a/jinja2/environment.py b/jinja2/environment.py index ed597799..58573a29 100644 --- a/jinja2/environment.py +++ b/jinja2/environment.py @@ -1069,7 +1069,7 @@ class TemplateStream(six.Iterator): """ close = False if isinstance(fp, six.string_types): - fp = open(fp, 'w') + fp = open(fp, encoding is None and 'w' or 'wb') close = True try: if encoding is not None: