Skip to content

Commit b3a68e5

Browse files
committed
Fixed ValueError exception which can occur when opening an old format persistent history file with a new version of cmd2
1 parent 8b45f3a commit b3a68e5

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.9.19 (TBD, 2019)
2+
* Bug Fixes
3+
* Fixed `ValueError` exception which could occur when an old format persistent history file is loaded with new `cmd2`
4+
15
## 0.9.18 (October 1, 2019)
26
* Bug Fixes
37
* Fixed bug introduced in 0.9.17 where help functions for hidden and disabled commands were not being filtered

cmd2/cmd2.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3592,7 +3592,8 @@ def _initialize_history(self, hist_file):
35923592
try:
35933593
with open(hist_file, 'rb') as fobj:
35943594
history = pickle.load(fobj)
3595-
except (AttributeError, EOFError, FileNotFoundError, ImportError, IndexError, KeyError, pickle.UnpicklingError):
3595+
except (AttributeError, EOFError, FileNotFoundError, ImportError, IndexError, KeyError, ValueError,
3596+
pickle.UnpicklingError):
35963597
# If any non-operating system error occurs when attempting to unpickle, just use an empty history
35973598
pass
35983599
except OSError as ex:

0 commit comments

Comments
 (0)