[diff] open schema file in text mode

Lets us write text to it under python 3.

authorJulien Cristau <julien.cristau@logilab.fr>
changesetd4de0f2a807f
branchdefault
phasepublic
hiddenno
parent revision#3ec3fdffed7d [test] drop unused import
child revision#3c331b5d749c reader: add fill_schema_from_namespace, #ea2a8ccadc28 [pkg] add dependency on six
files modified by this revision
diff.py
# HG changeset patch
# User Julien Cristau <julien.cristau@logilab.fr>
# Date 1406658107 -7200
# Tue Jul 29 20:21:47 2014 +0200
# Node ID d4de0f2a807fd51edb0bb41113094e8dc1299c77
# Parent 3ec3fdffed7dd8302bec3ff1ac9fe9aa767e94db
[diff] open schema file in text mode

Lets us write text to it under python 3.

diff --git a/diff.py b/diff.py
@@ -226,11 +226,11 @@
1      return ''.join(output)
2 
3  def schema2file(schema, output, permissionshandler, ignore=()):
4      """Save schema description of schema find
5      in directory schema_dir into output file"""
6 -    with open(output, 'wb') as description_file:
7 +    with open(output, 'w') as description_file:
8          description_file.write(schema2descr(schema, permissionshandler, ignore))
9 
10  def schema_diff(schema1, schema2, permissionshandler=nullhandler, diff_tool=None, ignore=()):
11      """schema 1 and 2 are CubicwebSchema
12      diff_tool is the name of tool use for file comparison