]> granicus.if.org Git - python/commitdiff
Open output files in text mode, after all they are text files.
authorGuido van Rossum <guido@python.org>
Fri, 23 Nov 2007 21:26:49 +0000 (21:26 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 23 Nov 2007 21:26:49 +0000 (21:26 +0000)
(Binary mode caused problems when "python" was 3.0.)

Parser/asdl_c.py

index 798650d6fbc009bef6479768510b854ea4885382..24b732c23bf1347c9088545eb73ad36e1dc63546 100755 (executable)
@@ -741,7 +741,7 @@ def main(srcfile):
         sys.exit(1)
     if INC_DIR:
         p = "%s/%s-ast.h" % (INC_DIR, mod.name)
-        f = open(p, "wb")
+        f = open(p, "w")
         f.write(auto_gen_msg)
         f.write('#include "asdl.h"\n\n')
         c = ChainOfVisitors(TypeDefVisitor(f),
@@ -754,7 +754,7 @@ def main(srcfile):
 
     if SRC_DIR:
         p = os.path.join(SRC_DIR, str(mod.name) + "-ast.c")
-        f = open(p, "wb")
+        f = open(p, "w")
         f.write(auto_gen_msg)
         f.write(c_file_msg % parse_version(mod))
         f.write('#include "Python.h"\n')