Skip to content

blurb: Quitting blurb without saving the original message results in KeyError #399

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

Closed
ericvsmith opened this issue May 3, 2021 · 1 comment

Comments

@ericvsmith
Copy link
Member

To reproduce in blurb 1.0.8: Run blurb. Exit the editor without saving any changes.

Result: a traceback with a KeyError:

$ blurb
Traceback (most recent call last):
File "/home/eric/venvs/py/bin/blurb", line 8, in
sys.exit(main())
File "/home/eric/venvs/py/lib/python3.8/site-packages/blurb.py", line 1651, in main
sys.exit(fn(*filtered_args, **kwargs))
File "/home/eric/venvs/py/lib/python3.8/site-packages/blurb.py", line 954, in add
blurb.load(tmp_path)
File "/home/eric/venvs/py/lib/python3.8/site-packages/blurb.py", line 553, in load
self.parse(text, metadata=metadata, filename=filename)
File "/home/eric/venvs/py/lib/python3.8/site-packages/blurb.py", line 543, in parse
finish_entry()
File "/home/eric/venvs/py/lib/python3.8/site-packages/blurb.py", line 495, in finish_entry
throw("Blurb 'body' text must not be empty!")
File "/home/eric/venvs/py/lib/python3.8/site-packages/blurb.py", line 486, in throw
raise BlurbError(f("Error in {filename}:{line_number}:\n{s}"))
File "/home/eric/venvs/py/lib/python3.8/site-packages/blurb.py", line 138, in f
return s.format_map(d)
KeyError: 'filename'

@ericvsmith
Copy link
Member Author

This is a duplicate of #299. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant