diff options
author | coadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu> | 2016-09-09 16:11:56 -0300 |
---|---|---|
committer | coadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu> | 2016-09-19 16:34:26 -0300 |
commit | 9897c7f409003d77762423096627923a5ff6a6b5 (patch) | |
tree | a01eca2b97e9c305af39d08be41a5c7ddf31f3bd /pcr/renpy-python3 | |
parent | 3c50dd67b0fec0d5710565fdd7164f3ca6b5a847 (diff) | |
download | abslibre-9897c7f409003d77762423096627923a5ff6a6b5.tar.gz abslibre-9897c7f409003d77762423096627923a5ff6a6b5.tar.bz2 abslibre-9897c7f409003d77762423096627923a5ff6a6b5.zip |
renpy-python3: fix more errors
Diffstat (limited to 'pcr/renpy-python3')
-rw-r--r-- | pcr/renpy-python3/PKGBUILD | 2 | ||||
-rw-r--r-- | pcr/renpy-python3/python3.patch | 87 |
2 files changed, 74 insertions, 15 deletions
diff --git a/pcr/renpy-python3/PKGBUILD b/pcr/renpy-python3/PKGBUILD index ff7ae3eba..5b43a8ced 100644 --- a/pcr/renpy-python3/PKGBUILD +++ b/pcr/renpy-python3/PKGBUILD @@ -26,7 +26,7 @@ sha256sums=('0eb0c763bf7e977db06039c69751f1ed5e69c4b738f7f6d975e99e8729eff58e' 'fccde3461617a098a78d938d9db782d403eda410a84ab52825a597498ab95834' '611edc07a40ccb8e04e8858847fc1d2a066d29c2ed54e5b357880a0605818dc5' 'c2d27a3f6b74f874a790ce6c12e9d4b718784478d8a8aa23c879d186f60a25ab' - '664b708f5d4f39d8c3006b796c7e07fadb73fc8fd60b67d29b48d91b89c1299b') + 'e2250ce41ea5f42d882de0fbcc0d3057ce8da8e755f150294e447e05340edaa9') prepare() { cd renpy-${pkgver}-source diff --git a/pcr/renpy-python3/python3.patch b/pcr/renpy-python3/python3.patch index 3c406515b..aa25f7772 100644 --- a/pcr/renpy-python3/python3.patch +++ b/pcr/renpy-python3/python3.patch @@ -1809,7 +1809,7 @@ index bf959b5..9ccce1c 100644 try: diff --git a/renpy/bootstrap.py b/renpy/bootstrap.py -index 9dbe2e0..285e571 100644 +index 9dbe2e0..9261c2b 100644 --- a/renpy/bootstrap.py +++ b/renpy/bootstrap.py @@ -64,8 +64,8 @@ def extra_imports(): @@ -1845,7 +1845,7 @@ index 9dbe2e0..285e571 100644 del os.environ["SDL_VIDEODRIVER"] - renpy_base = unicode(renpy_base, FSENCODING, "replace") -+ renpy_base = renpy_base.encode(FSENCODING, "replace").decode(FSENCODING, "replace") ++ renpy_base = str(renpy_base.encode(errors="replace"), FSENCODING, "replace") # If environment.txt exists, load it into the os.environ dictionary. if os.path.exists(renpy_base + "/environment.txt"): @@ -2991,7 +2991,7 @@ index 7be4c32..bac80f7 100644 if "Editor" in scope: editor = scope["Editor"]() diff --git a/renpy/error.py b/renpy/error.py -index d70fe2a..6e56038 100644 +index d70fe2a..513cd73 100644 --- a/renpy/error.py +++ b/renpy/error.py @@ -23,7 +23,7 @@ @@ -3014,6 +3014,21 @@ index d70fe2a..6e56038 100644 # Line is a number. +@@ -52,12 +52,12 @@ def write_utf8_traceback_list(out, l): + # or comes from inside Ren'Py. + + if isinstance(text, str): +- text = text.decode("utf-8", "replace") ++ text = text.encode(errors="replace").decode("utf-8", "replace") + + ul.append((filename, line, what, text)) + + for t in traceback.format_list(ul): +- out.write(t.encode("utf-8", "replace")) ++ out.write(str(t.encode("utf-8", "replace"), errors="replace")) + + + def traceback_list(tb): @@ -127,13 +127,13 @@ def open_error_file(fn, mode): try: @@ -3126,6 +3141,14 @@ index d70fe2a..6e56038 100644 f.write(full) f.close() +@@ -249,6 +249,6 @@ def report_exception(e, editor=True): + except: + pass + +- return simple.decode("utf-8", "replace"), full.decode("utf-8", "replace"), traceback_fn ++ return simple.encode(errors="replace").decode("utf-8", "replace"), full.encode(errors="replace").decode("utf-8", "replace"), traceback_fn + + diff --git a/renpy/execution.py b/renpy/execution.py index 224c631..a41b59a 100644 --- a/renpy/execution.py @@ -3211,9 +3234,18 @@ index 224c631..a41b59a 100644 self.images = old_images self.predict_return_stack = None diff --git a/renpy/exports.py b/renpy/exports.py -index faccd36..61f3c40 100644 +index faccd36..82bc282 100644 --- a/renpy/exports.py +++ b/renpy/exports.py +@@ -25,7 +25,7 @@ + # alone as part of the api. + + # Remember the real file. +-_file = file ++_file = open + + import renpy.display + import renpy.audio @@ -39,7 +39,7 @@ def renpy_pure(fn): name = fn @@ -3392,18 +3424,21 @@ index d66800c..1ba0fe5 100644 renpy.store._in_replay = label diff --git a/renpy/lint.py b/renpy/lint.py -index 088b89c..4ef99d2 100644 +index 088b89c..b6f131c 100644 --- a/renpy/lint.py +++ b/renpy/lint.py -@@ -28,7 +28,7 @@ import sys +@@ -28,9 +28,9 @@ import sys import collections import textwrap -import __builtin__ +import builtins - python_builtins = set(dir(__builtin__)) +-python_builtins = set(dir(__builtin__)) ++python_builtins = set(dir(builtins)) renpy_builtins = set() + + image_prefixes = None @@ -53,13 +53,13 @@ report_node = None # Reports a message to the user. def report(msg, *args): @@ -3940,7 +3975,7 @@ index 7751db1..c127e3f 100644 print_path(o) diff --git a/renpy/parser.py b/renpy/parser.py -index 0b48859..04c2a74 100644 +index 0b48859..1001749 100644 --- a/renpy/parser.py +++ b/renpy/parser.py @@ -37,7 +37,7 @@ parse_errors = [ ] @@ -4024,9 +4059,12 @@ index 0b48859..04c2a74 100644 parse_errors.append(e.message) return None -@@ -2371,9 +2371,9 @@ def report_parse_errors(): +@@ -2369,11 +2369,11 @@ def report_parse_errors(): + full_text = "" + f, error_fn = renpy.error.open_error_file("errors.txt", "w") - f.write(codecs.BOM_UTF8) +- f.write(codecs.BOM_UTF8) ++ f.write(str(codecs.BOM_UTF8)) - print >>f, "I'm sorry, but errors were detected in your script. Please correct the" - print >>f, "errors listed below, and try again." @@ -4620,7 +4658,7 @@ index 4a537eb..b393a53 100644 raise renpy.parser.ParseError( filename, diff --git a/renpy/script.py b/renpy/script.py -index 61d6b5f..98a6857 100644 +index 61d6b5f..5f31183 100644 --- a/renpy/script.py +++ b/renpy/script.py @@ -27,13 +27,13 @@ import renpy @@ -4653,7 +4691,7 @@ index 61d6b5f..98a6857 100644 self.serial = 0 - self.digest = md5.md5(renpy.version_only) -+ self.digest = hashlib.md5(renpy.version_only) ++ self.digest = hashlib.md5(renpy.version_only.encode()) + self.md5 = hashlib.md5 self.loaded_rpy = False @@ -4690,7 +4728,7 @@ index 61d6b5f..98a6857 100644 with open(fullfn, "rU") as fullf: - rpydigest = md5.md5(fullf.read()).digest() -+ rpydigest = hashlib.md5(fullf.read()).digest() ++ rpydigest = hashlib.md5(fullf.read().encode()).digest() self.write_rpyc_md5(f, rpydigest) @@ -4719,7 +4757,7 @@ index 61d6b5f..98a6857 100644 if os.path.exists(rpyfn): with open(rpyfn, "rU") as f: - rpydigest = md5.md5(f.read()).digest() -+ rpydigest = hashlib.md5(f.read()).digest() ++ rpydigest = hashlib.md5(f.read().encode()).digest() else: rpydigest = None @@ -4747,6 +4785,15 @@ index 61d6b5f..98a6857 100644 raise pass +@@ -763,7 +764,7 @@ class Script(object): + # bytecode. + for i in self.all_pycode: + +- key = i.get_hash() + MAGIC ++ key = i.get_hash() + str(MAGIC) + + code = self.bytecode_oldcache.get(key, None) + @@ -781,7 +782,7 @@ class Script(object): elif i.mode == 'eval': code = renpy.python.py_compile_eval_bytecode(i.source, filename=i.location[0], lineno=i.location[1]) @@ -4756,6 +4803,18 @@ index 61d6b5f..98a6857 100644 text = e.text +@@ -789,9 +790,9 @@ class Script(object): + text = '' + + try: +- text = text.decode("utf-8") ++ text = text.encode().decode("utf-8") + except: +- text = text.decode("latin-1") ++ text = text.encode().decode("latin-1") + + pem = renpy.parser.ParseError( + filename = e.filename, diff --git a/renpy/scriptedit.py b/renpy/scriptedit.py index 92994d0..6818c59 100644 --- a/renpy/scriptedit.py |