MonetDB: Jun2020 - Modernize: use text instead of universal_newl...

2020-07-02 Thread Sjoerd Mullender
Changeset: a9668cd3e62c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a9668cd3e62c
Modified Files:
sql/test/mapi/Tests/utf8test.SQL.py
Branch: Jun2020
Log Message:

Modernize: use text instead of universal_newlines.


diffs (52 lines):

diff --git a/sql/test/mapi/Tests/utf8test.SQL.py 
b/sql/test/mapi/Tests/utf8test.SQL.py
--- a/sql/test/mapi/Tests/utf8test.SQL.py
+++ b/sql/test/mapi/Tests/utf8test.SQL.py
@@ -5,10 +5,10 @@ try:
 except ImportError:
 import process
 
-def client(args, universal_newlines = True):
+def client(args, text=True):
 with process.client('sql', args=args,
  stdout=process.PIPE, stderr=process.PIPE,
- universal_newlines=universal_newlines) as clt:
+ text=text) as clt:
 return clt.communicate()
 
 def printit(file, string):
@@ -37,7 +37,7 @@ out, err = client(['-Eutf-8', '-fsql', '
 printit(sys.stdout, out)
 printit(sys.stderr, err)
 out, err = client(['-fraw', '-Eiso-8859-1', '-s', 'select * from utf8test'],
-  universal_newlines = False)
+  text=False)
 out = out.decode('iso-8859-1')
 err = err.decode('iso-8859-1')
 if sys.version_info[0] == 2:
@@ -46,7 +46,7 @@ if sys.version_info[0] == 2:
 printit(sys.stdout, out)
 printit(sys.stderr, err)
 out, err = client(['-fsql', '-Eiso-8859-1', '-s', 'select * from utf8test'],
-  universal_newlines = False)
+  text=False)
 out = out.decode('iso-8859-1')
 err = err.decode('iso-8859-1')
 if sys.version_info[0] == 2:
@@ -55,7 +55,7 @@ if sys.version_info[0] == 2:
 printit(sys.stdout, out)
 printit(sys.stderr, err)
 out, err = client(['-fraw', '-Eus-ascii', '-s', 'select * from utf8test'],
-  universal_newlines = False)
+  text=False)
 out = out.decode('us-ascii')
 err = err.decode('us-ascii')
 if sys.version_info[0] == 2:
@@ -64,7 +64,7 @@ if sys.version_info[0] == 2:
 printit(sys.stdout, out)
 printit(sys.stderr, err)
 out, err = client(['-fsql', '-Eus-ascii', '-s', 'select * from utf8test'],
-  universal_newlines = False)
+  text=False)
 out = out.decode('us-ascii')
 err = err.decode('us-ascii')
 if sys.version_info[0] == 2:
___
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list


MonetDB: Jun2020 - Modernize: use text instead of universal_newl...

2020-06-30 Thread Sjoerd Mullender
Changeset: f9b94247ae68 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f9b94247ae68
Modified Files:
testing/Mtest.py.in
testing/process.py
Branch: Jun2020
Log Message:

Modernize: use text instead of universal_newlines.


diffs (truncated from 367 to 300 lines):

diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -1475,7 +1475,7 @@ def ApproveOutput (env, TST) :
 f = openutf8(patch + '.0', 'w')
 proc = process.Popen(['diff', '-Bb', '-I^[#=]', '-I^MAPI *=', 
'-U0',
   stableOUTPUT, testOUTPUT],
- stdout = f, universal_newlines = True)
+ stdout=f, text=True)
 proc.wait()
 f.close()
 if os.path.getsize(patch + ".0"):
@@ -1519,12 +1519,12 @@ def ApproveOutput (env, TST) :
 if not verbose:
 patchcmd.append('--quiet')
 proc = process.Popen(patchcmd + [stableOUTPUT, patch + '.1'],
- universal_newlines = True)
+ text=True)
 proc.wait()
 f = openutf8(patch, 'w')
 proc = process.Popen(['diff', '-u', stableOUTPUT + '.ORG',
   stableOUTPUT],
- stdout = f, universal_newlines = True)
+ stdout=f, text=True)
 proc.wait()
 f.close()
 remove(stableOUTPUT + ".ORG")
@@ -1544,7 +1544,7 @@ def ApproveOutput (env, TST) :
 elif f != thefile and test.match(f):
 remove(os.path.join(dir or os.curdir, f + '.rej'))
 remove(os.path.join(dir or os.curdir, f + '.orig'))
-proc = process.Popen(patchcmd + ['--forward', 
os.path.join(dir or os.curdir, f)], stdin = openutf8(patch), universal_newlines 
= True)
+proc = process.Popen(patchcmd + ['--forward', 
os.path.join(dir or os.curdir, f)], stdin=openutf8(patch), text=True)
 proc.wait()
 if os.path.exists(os.path.join(dir or os.curdir, f 
+ '.rej')):
 list.append(f)
@@ -1638,9 +1638,9 @@ def returnCode(proc, f = None):
 if procdebug:
 print('Starting: coredumpctl -q info %d' % proc.pid)
 p = process.Popen(['coredumpctl', '-q' ,'info', 
str(proc.pid)],
-  stdout = process.PIPE,
-  stderr = process.PIPE,
-  universal_newlines = True)
+  stdout=process.PIPE,
+  stderr=process.PIPE,
+  text=True)
 out, err = p.communicate()
 if not err and out:
 f.write(out)
@@ -1660,9 +1660,9 @@ def returnCode(proc, f = None):
 if procdebug:
 print('Starting: coredumpctl -q info %d' % proc.pid)
 p = process.Popen(['coredumpctl', '-q' ,'info', 
str(proc.pid)],
-  stdout = process.PIPE,
-  stderr = process.PIPE,
-  universal_newlines = True)
+  stdout=process.PIPE,
+  stderr=process.PIPE,
+  text=True)
 out, err = p.communicate()
 if not err and out:
 f.write(out)
@@ -1700,8 +1700,8 @@ def GetBitsAndModsAndThreads(env) :
 if procdebug:
 print('GetBitsAndModsAndThreads: starting process "%s" (inpipe, 
outpipe, errpipe)\n' % '" "'.join(cmd))
 setpgrp = True
-proc = process.Popen(cmd, stdin = process.PIPE, stdout = process.PIPE,
- stderr = process.PIPE, universal_newlines = True)
+proc = process.Popen(cmd, stdin=process.PIPE, stdout=process.PIPE,
+ stderr=process.PIPE, text=True)
 proc.killed = False
 proc.onechild = True
 t = Timer(float(par['TIMEOUT']), killProc, args = [proc, proc.stderr, cmd])
@@ -1720,7 +1720,7 @@ def GetBitsAndModsAndThreads(env) :
 if procdebug:
 print('GetBitsAndModsAndThreads: starting process "%s" 
(inpipe, outpipe, errpipe)\n' % '" "'.join(cmd))
 clnt = process.Popen(cmd, stdin=process.PIPE, stdout=process.PIPE,
- stderr=process.PIPE, universal_newlines=True)
+ stderr=process.PIPE, text=True)
 input = '''\
 c :