From 6d4ee9791b0819b76d85d55c9d50b499e43b2b47 Mon Sep 17 00:00:00 2001 From: Wong Mun Hou Date: Mon, 11 Jun 2018 18:59:28 +0800 Subject: [PATCH] Fix NameError: unichr not defined in python3 unichr has been replaced by chr in python 3 --- oletools/olevba3.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oletools/olevba3.py b/oletools/olevba3.py index 85d8336d..57f8ac3d 100644 --- a/oletools/olevba3.py +++ b/oletools/olevba3.py @@ -906,7 +906,7 @@ def vba_chr_tostr(t): if i>=0 and i<=255: return VbaExpressionString(chr(i)) else: - return VbaExpressionString(unichr(i).encode('utf-8', 'backslashreplace')) + return VbaExpressionString(chr(i).encode('utf-8', 'backslashreplace')) except ValueError: log.exception('ERROR: incorrect parameter value for chr(): %r' % i) return VbaExpressionString('Chr(%r)' % i)