Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kernel crash with empty history #260

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions IPython/core/history.py
Expand Up @@ -105,7 +105,7 @@ def __init__(self, shell):
# Object is fully initialized, we can now call methods on it.

# Fill the history zero entry, user counter starts at 1
self.store_inputs('\n', '\n')
self.store_inputs('', '')

# Create and start the autosaver.
self.autosave_flag = threading.Event()
Expand Down Expand Up @@ -169,6 +169,9 @@ def reload_history(self):
return
self.input_hist_parsed = hist['parsed']
self.input_hist_raw = hist['raw']
if not self.input_hist_raw:
# Fill the history zero entry, user counter starts at 1
self.store_inputs('', '')
if self.shell.has_readline:
self.populate_readline_history()

Expand All @@ -180,7 +183,7 @@ def get_history(self, index=None, raw=False, output=True):
Parameters
----------
index : n or (n1, n2) or None
If n, then the last entries. If a tuple, then all in
If n, then the last n entries. If a tuple, then all in
range(n1, n2). If None, then all entries. Raises IndexError if
the format of index is incorrect.
raw : bool
Expand Down