]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Make dump() work Python 3.3
authorArmin Ronacher <armin.ronacher@active-4.com>
Sat, 18 May 2013 10:46:35 +0000 (11:46 +0100)
committerArmin Ronacher <armin.ronacher@active-4.com>
Sat, 18 May 2013 10:46:35 +0000 (11:46 +0100)
jinja2/environment.py

index ed5977996cc2a32c2473087a8183140a0484fcd7..58573a29ca3af62bf3d33747f3760532d326a5e6 100644 (file)
@@ -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: