summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/tools/onbld/Checks/ProcessCheck.py4
-rw-r--r--usr/src/tools/onbld/Checks/SpellCheck.py3
-rw-r--r--usr/src/tools/scripts/git-pbchk.py6
3 files changed, 7 insertions, 6 deletions
diff --git a/usr/src/tools/onbld/Checks/ProcessCheck.py b/usr/src/tools/onbld/Checks/ProcessCheck.py
index 1d3bf9df07..883ea46692 100644
--- a/usr/src/tools/onbld/Checks/ProcessCheck.py
+++ b/usr/src/tools/onbld/Checks/ProcessCheck.py
@@ -24,7 +24,7 @@
# Use is subject to license terms.
#
-# Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
+# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
#
# Wrap a command-line check tool in a pythonic API
@@ -46,7 +46,7 @@ def processcheck(command, args, inpt, output):
# don't deadlock with the child if both pipes fill.
#
try:
- tmpfile = tempfile.TemporaryFile(prefix=command, mode="w+b")
+ tmpfile = tempfile.TemporaryFile(prefix=command, mode="w+")
except EnvironmentError as e:
output.write("Could not create temporary file: %s\n" % e)
return (3, None)
diff --git a/usr/src/tools/onbld/Checks/SpellCheck.py b/usr/src/tools/onbld/Checks/SpellCheck.py
index bb89306cc7..0d07017846 100644
--- a/usr/src/tools/onbld/Checks/SpellCheck.py
+++ b/usr/src/tools/onbld/Checks/SpellCheck.py
@@ -21,7 +21,7 @@
#
# Copyright 2016 Joyent, Inc.
-# Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
+# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
#
import re, sys
@@ -282,6 +282,7 @@ def spellcheck(fh, filename=None, output=sys.stderr, **opts):
fh.seek(0)
for line in fh:
+ line = line.decode(errors='replace')
for entry in misspellingREs:
ret |= check(spellMsg, output, filename, line,
lineno, entry)
diff --git a/usr/src/tools/scripts/git-pbchk.py b/usr/src/tools/scripts/git-pbchk.py
index dc40a5d222..559cf7e9e5 100644
--- a/usr/src/tools/scripts/git-pbchk.py
+++ b/usr/src/tools/scripts/git-pbchk.py
@@ -21,7 +21,7 @@
# Copyright (c) 2015, 2016 by Delphix. All rights reserved.
# Copyright 2016 Nexenta Systems, Inc.
# Copyright (c) 2019, Joyent, Inc.
-# Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
+# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
#
from __future__ import print_function
@@ -260,7 +260,7 @@ def cstyle(root, parent, flist, output):
ret = 0
output.write("C style:\n")
for f in flist(lambda x: x.endswith('.c') or x.endswith('.h')):
- with io.open(f, encoding='utf-8', errors='replace') as fh:
+ with io.open(f, mode='rb') as fh:
ret |= CStyle.cstyle(fh, output=output, picky=True,
check_posix_types=True,
check_continuation=True)
@@ -279,7 +279,7 @@ def manlint(root, parent, flist, output):
output.write("Man page format/spelling:\n")
ManfileRE = re.compile(r'.*\.[0-9][a-z]*$', re.IGNORECASE)
for f in flist(lambda x: ManfileRE.match(x)):
- with io.open(f, encoding='utf-8', errors='replace') as fh:
+ with io.open(f, mode='rb') as fh:
ret |= ManLint.manlint(fh, output=output, picky=True)
ret |= SpellCheck.spellcheck(fh, output=output)
return ret