Skip to content

Commit

Permalink
[FIX] load_data: switch to binary mode for recent versions
Browse files Browse the repository at this point in the history
  • Loading branch information
jue-adhoc committed Dec 17, 2024
1 parent 72298c3 commit 9eb1e86
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion openupgradelib/openupgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,10 @@ def load_data(env_or_cr, module_name, filename, idref=None, mode="init"):
pathname = os.path.join(module_name, filename)

try:
fp = tools.file_open(pathname)
if version_info[0] >= 11:
fp = tools.file_open(pathname, "rb")
else:
fp = tools.file_open(pathname)
except OSError:
if tools.config.get("upgrade_path"):
for path in tools.config["upgrade_path"].split(","):
Expand Down

0 comments on commit 9eb1e86

Please sign in to comment.