aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2023-08-24 23:35:36 +0000
committerDan Willemsen <dwillemsen@google.com>2023-08-24 23:35:40 +0000
commit58c5a33bda2763c68b57abb97f1ccfbfc199cabe (patch)
tree7e220299c48092e09a609f176e26b5befbd50f42
parent1081fb69644714e0022b02bac6c1fce43d70ceae (diff)
downloadnanopb-c-58c5a33bda2763c68b57abb97f1ccfbfc199cabe.tar.gz
Fix python 3.11 compatibility
This was fixed upstream in: https://github.com/nanopb/nanopb/commit/d2068ad9094ed5e249141056ba34e0a7d994ef50 https://github.com/nanopb/nanopb/commit/01e9186a8b8b9856d2438ee2886f3464b9a79f88 But we're still on the 0.3 branch, so backport these open() changes. Bug: 278602456 Change-Id: Ie9c3d1e3540d6f8373dfd96fd8e1cc41913bdbae Test: treehugger
-rwxr-xr-xgenerator/nanopb_generator.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/generator/nanopb_generator.py b/generator/nanopb_generator.py
index b4f1d83..d145dd3 100755
--- a/generator/nanopb_generator.py
+++ b/generator/nanopb_generator.py
@@ -1641,7 +1641,7 @@ def parse_file(filename, fdesc, options):
optfilename = os.path.join(p, optfilename)
if options.verbose:
sys.stderr.write('Reading options from ' + optfilename + '\n')
- Globals.separate_options = read_options_file(open(optfilename, "rU"))
+ Globals.separate_options = read_options_file(open(optfilename, 'r', encoding = 'utf-8'))
break
else:
# If we are given a full filename and it does not exist, give an error.