diff --git a/demos/subst/wscript b/demos/subst/wscript index 521bed2c..0d6dab82 100644 --- a/demos/subst/wscript +++ b/demos/subst/wscript @@ -19,7 +19,7 @@ def build(bld): features = 'subst', # the feature 'subst' overrides the source/target processing source = 'foo.in', # list of string or nodes target = 'foo.txt', # list of strings or nodes - encoding = 'ascii', # file encoding for python3, default is ISO8859-1 + encoding = 'ascii', # file encoding for python3, default is latin-1 install_path = '/tmp/uff/', # installation path, optional chmod = Utils.O755, # installation mode, optional PREFIX = bld.env.PREFIX, # variables to use in the substitution diff --git a/playground/cuda/wscript b/playground/cuda/wscript index f2592536..64053112 100644 --- a/playground/cuda/wscript +++ b/playground/cuda/wscript @@ -1,5 +1,5 @@ #!/usr/bin/env python -# encoding: ISO8859-1 +# encoding: utf-8 # Thomas Nagy, 2010 top = '.' diff --git a/playground/cython/wscript b/playground/cython/wscript index 9b344726..1cdd8a41 100644 --- a/playground/cython/wscript +++ b/playground/cython/wscript @@ -1,5 +1,5 @@ #!/usr/bin/env python -# encoding: ISO8859-1 +# encoding: utf-8 # Thomas Nagy, 2010 from waflib import Logs diff --git a/utils/verify-sig.py b/utils/verify-sig.py index 950a4972..b555add2 100755 --- a/utils/verify-sig.py +++ b/utils/verify-sig.py @@ -1,10 +1,10 @@ #! /usr/bin/env python -# encoding: ISO8859-1 +# encoding: utf-8 # Thomas Nagy, 2014-2015 """ A simple file for verifying signatures in signed waf files -This script is meant for Python >= 2.6 and the encoding is bytes - ISO8859-1 +This script is meant for Python >= 2.6 and the encoding is bytes - latin-1 Distributing detached signatures is boring """ @@ -33,14 +33,14 @@ if __name__ == '__main__': try: txt = f.read() - lastline = txt.decode('ISO8859-1').splitlines()[-1] # just the last line + lastline = txt.decode('latin-1').splitlines()[-1] # just the last line if not lastline.startswith('#-----BEGIN PGP SIGNATURE-----'): print("ERROR: there is no signature to verify in %r :-/" % infile) sys.exit(1) sigtext = lastline.replace('\\n', '\n') # convert newlines sigtext = sigtext[1:] # omit the '# character' - sigtext = sigtext.encode('ISO8859-1') # python3 + sigtext = sigtext.encode('latin-1') # python3 f2.write(sigtext) f1.write(txt[:-len(lastline) - 1]) # one newline character was eaten from splitlines() diff --git a/waf-light b/waf-light index dbe1a0e6..fdd44509 100755 --- a/waf-light +++ b/waf-light @@ -1,5 +1,5 @@ #!/usr/bin/env python -# encoding: ISO8859-1 +# encoding: latin-1 # Thomas Nagy, 2005-2016 # """ diff --git a/waflib/Context.py b/waflib/Context.py index 3194b678..d5063237 100644 --- a/waflib/Context.py +++ b/waflib/Context.py @@ -355,14 +355,14 @@ class Context(ctx): if out: if not isinstance(out, str): - out = out.decode(sys.stdout.encoding or 'iso8859-1', errors='replace') + out = out.decode(sys.stdout.encoding or 'latin-1', errors='replace') if self.logger: self.logger.debug('out: %s', out) else: Logs.info(out, extra={'stream':sys.stdout, 'c1': ''}) if err: if not isinstance(err, str): - err = err.decode(sys.stdout.encoding or 'iso8859-1', errors='replace') + err = err.decode(sys.stdout.encoding or 'latin-1', errors='replace') if self.logger: self.logger.error('err: %s' % err) else: @@ -440,9 +440,9 @@ class Context(ctx): raise Errors.WafError('Execution failure: %s' % str(e), ex=e) if not isinstance(out, str): - out = out.decode(sys.stdout.encoding or 'iso8859-1', errors='replace') + out = out.decode(sys.stdout.encoding or 'latin-1', errors='replace') if not isinstance(err, str): - err = err.decode(sys.stdout.encoding or 'iso8859-1', errors='replace') + err = err.decode(sys.stdout.encoding or 'latin-1', errors='replace') if out and quiet != STDOUT and quiet != BOTH: self.to_log('out: %s' % out) diff --git a/waflib/Node.py b/waflib/Node.py index 5e5bf471..44a23354 100644 --- a/waflib/Node.py +++ b/waflib/Node.py @@ -121,7 +121,7 @@ class Node(object): """ raise Errors.WafError('nodes are not supposed to be copied') - def read(self, flags='r', encoding='ISO8859-1'): + def read(self, flags='r', encoding='latin-1'): """ Reads and returns the contents of the file represented by this node, see :py:func:`waflib.Utils.readf`:: @@ -137,7 +137,7 @@ class Node(object): """ return Utils.readf(self.abspath(), flags, encoding) - def write(self, data, flags='w', encoding='ISO8859-1'): + def write(self, data, flags='w', encoding='latin-1'): """ Writes data to the file represented by this node, see :py:func:`waflib.Utils.writef`:: diff --git a/waflib/Task.py b/waflib/Task.py index 53175edf..b29365a5 100644 --- a/waflib/Task.py +++ b/waflib/Task.py @@ -863,10 +863,10 @@ if sys.hexversion > 0x3000000: try: return self.uid_ except AttributeError: - m = Utils.md5(self.__class__.__name__.encode('iso8859-1', 'xmlcharrefreplace')) + m = Utils.md5(self.__class__.__name__.encode('latin-1', 'xmlcharrefreplace')) up = m.update for x in self.inputs + self.outputs: - up(x.abspath().encode('iso8859-1', 'xmlcharrefreplace')) + up(x.abspath().encode('latin-1', 'xmlcharrefreplace')) self.uid_ = m.digest() return self.uid_ uid.__doc__ = Task.uid.__doc__ diff --git a/waflib/TaskGen.py b/waflib/TaskGen.py index 35a8f562..63c87517 100644 --- a/waflib/TaskGen.py +++ b/waflib/TaskGen.py @@ -723,11 +723,11 @@ class subst_pc(Task.Task): self.force_permissions() return ret - code = self.inputs[0].read(encoding=getattr(self.generator, 'encoding', 'ISO8859-1')) + code = self.inputs[0].read(encoding=getattr(self.generator, 'encoding', 'latin-1')) if getattr(self.generator, 'subst_fun', None): code = self.generator.subst_fun(self, code) if code is not None: - self.outputs[0].write(code, encoding=getattr(self.generator, 'encoding', 'ISO8859-1')) + self.outputs[0].write(code, encoding=getattr(self.generator, 'encoding', 'latin-1')) self.force_permissions() return None @@ -758,7 +758,7 @@ class subst_pc(Task.Task): d[x] = tmp code = code % d - self.outputs[0].write(code, encoding=getattr(self.generator, 'encoding', 'ISO8859-1')) + self.outputs[0].write(code, encoding=getattr(self.generator, 'encoding', 'latin-1')) self.generator.bld.raw_deps[self.uid()] = lst # make sure the signature is updated diff --git a/waflib/Tools/c_tests.py b/waflib/Tools/c_tests.py index 6e5f8213..f7ddcf5b 100644 --- a/waflib/Tools/c_tests.py +++ b/waflib/Tools/c_tests.py @@ -199,7 +199,7 @@ class grep_for_endianness(Task.Task): """ color = 'PINK' def run(self): - txt = self.inputs[0].read(flags='rb').decode('iso8859-1') + txt = self.inputs[0].read(flags='rb').decode('latin-1') if txt.find('LiTTleEnDian') > -1: self.generator.tmp.append('little') elif txt.find('BIGenDianSyS') > -1: diff --git a/waflib/Utils.py b/waflib/Utils.py index 627785d8..eb000d80 100644 --- a/waflib/Utils.py +++ b/waflib/Utils.py @@ -188,7 +188,7 @@ is_win32 = os.sep == '\\' or sys.platform == 'win32' # msys2 Whether this system is a Windows series """ -def readf(fname, m='r', encoding='ISO8859-1'): +def readf(fname, m='r', encoding='latin-1'): """ Reads an entire file into a string. See also :py:meth:`waflib.Node.Node.readf`:: @@ -226,7 +226,7 @@ def readf(fname, m='r', encoding='ISO8859-1'): f.close() return txt -def writef(fname, data, m='w', encoding='ISO8859-1'): +def writef(fname, data, m='w', encoding='latin-1'): """ Writes an entire file from a string. See also :py:meth:`waflib.Node.Node.writef`:: @@ -274,7 +274,7 @@ def h_file(fname): f.close() return m.digest() -def readf_win32(f, m='r', encoding='ISO8859-1'): +def readf_win32(f, m='r', encoding='latin-1'): flags = os.O_NOINHERIT | os.O_RDONLY if 'b' in m: flags |= os.O_BINARY @@ -304,7 +304,7 @@ def readf_win32(f, m='r', encoding='ISO8859-1'): f.close() return txt -def writef_win32(f, data, m='w', encoding='ISO8859-1'): +def writef_win32(f, data, m='w', encoding='latin-1'): if sys.hexversion > 0x3000000 and not 'b' in m: data = data.encode(encoding) m += 'b' @@ -473,7 +473,7 @@ def split_path_msys(path): global msysroot if not msysroot: # msys has python 2.7 or 3, so we can use this - msysroot = subprocess.check_output(['cygpath', '-w', '/']).decode(sys.stdout.encoding or 'iso8859-1') + msysroot = subprocess.check_output(['cygpath', '-w', '/']).decode(sys.stdout.encoding or 'latin-1') msysroot = msysroot.strip() path = os.path.normpath(msysroot + os.sep + path) return split_path_win32(path) @@ -630,7 +630,7 @@ def h_cmd(ins): # or just a python function ret = str(h_fun(ins)) if sys.hexversion > 0x3000000: - ret = ret.encode('iso8859-1', 'xmlcharrefreplace') + ret = ret.encode('latin-1', 'xmlcharrefreplace') return ret reg_subst = re.compile(r"(\\\\)|(\$\$)|\$\{([^}]+)\}") diff --git a/waflib/extras/c_emscripten.py b/waflib/extras/c_emscripten.py index ecdaf2e4..e1ac494f 100644 --- a/waflib/extras/c_emscripten.py +++ b/waflib/extras/c_emscripten.py @@ -32,7 +32,7 @@ def get_emscripten_version(conf, cc): conf.fatal('Could not determine emscripten version %r: %s' % (cmd, e)) if not isinstance(out, str): - out = out.decode(sys.stdout.encoding or 'iso8859-1') + out = out.decode(sys.stdout.encoding or 'latin-1') k = {} out = out.splitlines() diff --git a/waflib/extras/codelite.py b/waflib/extras/codelite.py index 2aef4e3e..d24bb0f6 100644 --- a/waflib/extras/codelite.py +++ b/waflib/extras/codelite.py @@ -302,7 +302,7 @@ def rm_blank_lines(txt): BOM = '\xef\xbb\xbf' try: - BOM = bytes(BOM, 'iso8859-1') # python 3 + BOM = bytes(BOM, 'latin-1') # python 3 except (TypeError, NameError): pass diff --git a/waflib/extras/msvs.py b/waflib/extras/msvs.py index 18d6b415..87872612 100644 --- a/waflib/extras/msvs.py +++ b/waflib/extras/msvs.py @@ -359,7 +359,7 @@ def rm_blank_lines(txt): BOM = '\xef\xbb\xbf' try: - BOM = bytes(BOM, 'iso8859-1') # python 3 + BOM = bytes(BOM, 'latin-1') # python 3 except TypeError: pass diff --git a/waflib/extras/netcache_client.py b/waflib/extras/netcache_client.py index 5ae19692..71609570 100644 --- a/waflib/extras/netcache_client.py +++ b/waflib/extras/netcache_client.py @@ -40,7 +40,7 @@ all_sigs_in_cache = (0.0, []) def put_data(conn, data): if sys.hexversion > 0x3000000: - data = data.encode('iso8859-1') + data = data.encode('latin-1') cnt = 0 while cnt < len(data): sent = conn.send(data[cnt:]) @@ -107,8 +107,8 @@ def read_header(conn): buf.append(data) cnt += len(data) if sys.hexversion > 0x3000000: - ret = ''.encode('iso8859-1').join(buf) - ret = ret.decode('iso8859-1') + ret = ''.encode('latin-1').join(buf) + ret = ret.decode('latin-1') else: ret = ''.join(buf) return ret @@ -140,8 +140,8 @@ def check_cache(conn, ssig): cnt += len(data) if sys.hexversion > 0x3000000: - ret = ''.encode('iso8859-1').join(buf) - ret = ret.decode('iso8859-1') + ret = ''.encode('latin-1').join(buf) + ret = ret.decode('latin-1') else: ret = ''.join(buf) diff --git a/waflib/extras/print_commands.py b/waflib/extras/print_commands.py index 805dac9c..42233259 100644 --- a/waflib/extras/print_commands.py +++ b/waflib/extras/print_commands.py @@ -62,14 +62,14 @@ def exec_command(self, cmd, **kw): if out: if not isinstance(out, str): - out = out.decode(sys.stdout.encoding or 'iso8859-1') + out = out.decode(sys.stdout.encoding or 'latin-1') if self.logger: self.logger.debug('out: %s' % out) else: Logs.info(out, extra={'stream':sys.stdout, 'c1': ''}) if err: if not isinstance(err, str): - err = err.decode(sys.stdout.encoding or 'iso8859-1') + err = err.decode(sys.stdout.encoding or 'latin-1') if self.logger: self.logger.error('err: %s' % err) else: diff --git a/waflib/fixpy2.py b/waflib/fixpy2.py index 92daa72f..f6a2abc7 100644 --- a/waflib/fixpy2.py +++ b/waflib/fixpy2.py @@ -56,7 +56,7 @@ def subst(*k): def r1(code): "utf-8 fixes for python < 2.6" code = code.replace('as e:', ',e:') - code = code.replace(".decode(sys.stdout.encoding or'iso8859-1',errors='replace')", '') + code = code.replace(".decode(sys.stdout.encoding or'latin-1',errors='replace')", '') return code.replace('.encode()', '') @subst('Runner.py') diff --git a/zip/waf-zip b/zip/waf-zip index 9a7553a2..06e8ccee 100755 --- a/zip/waf-zip +++ b/zip/waf-zip @@ -1,5 +1,5 @@ #!/usr/bin/env python -# encoding: ISO8859-1 +# encoding: latin-1 # Thomas Nagy, 2005-2011 """