Skip to content

Commit

Permalink
Ensure pickle files can be read by earlier versions of NVDA (#7105) (#…
Browse files Browse the repository at this point in the history
…10255)

Impacts both the add-ons state and the updater state files.
Both are now written using pickle protocol 0 so that Python 2 version of NVDA
can read them in case of downgrading.

Re #10224 (comment)
  • Loading branch information
JulienCochuyt authored and michaelDCurran committed Sep 23, 2019
1 parent f8ad5c4 commit e9cfa1b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion source/addonHandler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def saveState():
try:
# #9038: Python 3 requires binary format when working with pickles.
with open(statePath, "wb") as f:
pickle.dump(state, f)
pickle.dump(state, f, protocol=0)
except:
log.debugWarning("Error saving state", exc_info=True)

Expand Down
2 changes: 1 addition & 1 deletion source/updateCheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ def saveState():
try:
# #9038: Python 3 requires binary format when working with pickles.
with open(_stateFilename, "wb") as f:
pickle.dump(state, f)
pickle.dump(state, f, protocol=0)
except:
log.debugWarning("Error saving state", exc_info=True)

Expand Down

0 comments on commit e9cfa1b

Please sign in to comment.