Changeset: 57057faa313c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=57057faa313c
Modified Files:
testing/Mconvert.py.in
testing/Mtest.py.in
testing/Mz.py.in
Branch: default
Log Message:
Even more UTF-8
diffs (131 lines):
diff --git a/testing/Mconvert.py.in b/testing/Mconvert.py.in
--- a/testing/Mconvert.py.in
+++ b/testing/Mconvert.py.in
@@ -1182,7 +1182,7 @@ def RunTest(env, test, oktests, pSrvr):
MAPIsockets = None
if test.get('is_src_link', False) and not os.path.isfile(TST + EXT):
- with open(test.get('test_path') + test.get('tail'), 'r') as f:
+ with openutf8(test.get('test_path') + test.get('tail'), 'r') as f:
TSTSRC = expandvars(f.readline().strip(), env)
if os.path.isfile(TSTSRC):
try:
@@ -1199,8 +1199,8 @@ def RunTest(env, test, oktests, pSrvr):
MAPIsockets[1].close()
return TX,F_SKIP,reason,links
elif test.get('is_input', False) and not os.path.isfile(TST+EXT):
- with open(os.path.join(TSTTRGDIR, TST + EXT), 'w') as fout:
- with open(test.get('test_path') + test.get('tail'), 'r') as f:
+ with openutf8(os.path.join(TSTTRGDIR, TST + EXT), 'w') as fout:
+ with openutf8(test.get('test_path') + test.get('tail'), 'r')
as f:
for l in f:
fout.write(expandvars(l, env))
else:
@@ -1248,7 +1248,7 @@ def RunTest(env, test, oktests, pSrvr):
prred('ERROR: ')
print(os.path.join(TSTDIR, TST + EXT))
print('========================================')
- with open(TestErrFile, 'r') as f:
+ with openutf8(TestErrFile, 'r') as f:
print(f.read())
print()
@@ -1626,8 +1626,8 @@ class ServerClass:
def create_mserver5(dbpath, timeout=0, env={}, outfile=None, errfile=None,
options=[]):
port = int(env.get('MAPIPORT', randomPort(30000, 39999)))
pollfile = os.path.join(dbpath, '.started')
- outfile = open(outfile, 'a') if outfile else sys.stdout
- errfile = open(errfile, 'a') if errfile else sys.stderr
+ outfile = openutf8(outfile, 'a') if outfile else sys.stdout
+ errfile = openutf8(errfile, 'a') if errfile else sys.stderr
cmd = splitcommand(env['exe']['mserver5'][1]) + ['--dbpath=%s' % dbpath] +
options
TSTPREF = env.get('TSTPREF')
if env.get('MULTIFARM'):
@@ -1718,7 +1718,7 @@ def RunSQLLogicTest(env, Test, TestOut,
import MonetDBtesting.sqllogictest as sqllogictest
exit_code = None
msg = None
- with open(TestErr, 'w') as f:
+ with openutf8(TestErr, 'w') as f:
sql = sqllogictest.SQLLogic(out=f)
if TestOut:
sql.res = openutf8(TestOut, 'w')
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -2260,7 +2260,7 @@ def RunTest(env, TST, BusyPorts, COND, o
else:
titlefmt = '-tTest <a href="%s%s">%s%s</a> (<a
href="%s.%%s.diff.html">%%s</a>)' % (TST, EXT, TST, EXT, TST)
diff_html = openutf8('%s.out.diff.html' % TST,"w")
- out = open('%s.test.out' % TST).read()
+ out = openutf8('%s.test.out' % TST).read()
Element('html', None,
# Element('head', None,
# Element('style', None,
@@ -2278,7 +2278,7 @@ def RunTest(env, TST, BusyPorts, COND, o
diff_html.write('<!--NoDiffs-->\n')
diff_html.close()
diff_html = openutf8('%s.err.diff.html' % TST,"w")
- err = open('%s.test.err' % TST).read()
+ err = openutf8('%s.test.err' % TST).read()
Element('html', None,
# Element('head', None,
# Element('style', None,
diff --git a/testing/Mz.py.in b/testing/Mz.py.in
--- a/testing/Mz.py.in
+++ b/testing/Mz.py.in
@@ -1132,7 +1132,7 @@ def RunTest(env, test, oktests, pSrvr):
if not env.get('NOCLEAN'):
raise
if f.endswith('.src'):
- with open(f) as fp:
+ with openutf8(f) as fp:
src = expandvars(fp.readline().strip(), env)
if os.path.isfile(src):
f = f[:-4]
@@ -1152,8 +1152,8 @@ def RunTest(env, test, oktests, pSrvr):
MAPIsockets = None
if test.get('is_input', False) and not os.path.isfile(TST+EXT):
- with open(os.path.join(TSTTRGDIR, TST + EXT), 'w') as fout:
- with open(test.get('test_path') + test.get('tail'), 'r') as f:
+ with openutf8(os.path.join(TSTTRGDIR, TST + EXT), 'w') as fout:
+ with openutf8(test.get('test_path') + test.get('tail'), 'r')
as f:
for l in f:
fout.write(expandvars(l, env))
else:
@@ -1198,12 +1198,12 @@ def RunTest(env, test, oktests, pSrvr):
res = diff(stable_file, TestOutFile)
except Exception as e:
exit_code = F_ERROR
- with open(TestErrFile, 'a') as f:
+ with openutf8(TestErrFile, 'a') as f:
f.write(repr(e))
else:
if res:
exit_code = F_ERROR
- with open(TestErrFile, 'a') as f:
+ with openutf8(TestErrFile, 'a') as f:
f.write(res)
t1 = time.time()
@@ -1215,7 +1215,7 @@ def RunTest(env, test, oktests, pSrvr):
prred('ERROR: ')
print(os.path.join(TSTDIR, TST + EXT))
print('========================================')
- with open(TestErrFile, 'r') as f:
+ with openutf8(TestErrFile, 'r') as f:
print(f.read())
print()
@@ -1597,8 +1597,8 @@ class ServerClass:
def create_mserver5(dbpath, timeout=0, env={}, outfile=None, errfile=None,
options=[]):
port = int(env.get('MAPIPORT', randomPort(30000, 39999)))
pollfile = os.path.join(dbpath, '.started')
- outfile = open(outfile, 'a') if outfile else sys.stdout
- errfile = open(errfile, 'a') if errfile else sys.stderr
+ outfile = openutf8(outfile, 'a') if outfile else sys.stdout
+ errfile = openutf8(errfile, 'a') if errfile else sys.stderr
cmd = splitcommand(env['exe']['mserver5'][1]) + ['--dbpath=%s' % dbpath] +
options
TSTPREF = env.get('TSTPREF')
if env.get('MULTIFARM'):
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list