Skip to content

KeyError 'filename' when two issues indicated #381

Closed
@jaraco

Description

@jaraco

I was using blurb on a PR that affects two issues (python/cpython#23010) and attempted to create a blurb for it with the tool, adding two bpos to the issue. When I did, it tried to fail with a nice error message but instead failed with a KeyError:

cpython bugfix/bpo-42163 $ blurb add
Traceback (most recent call last):
  File "/Users/jaraco/.local/bin/blurb", line 8, in <module>
    sys.exit(main())
  File "/Users/jaraco/.local/pipx/venvs/blurb/lib/python3.9/site-packages/blurb.py", line 1651, in main
    sys.exit(fn(*filtered_args, **kwargs))
  File "/Users/jaraco/.local/pipx/venvs/blurb/lib/python3.9/site-packages/blurb.py", line 954, in add
    blurb.load(tmp_path)
  File "/Users/jaraco/.local/pipx/venvs/blurb/lib/python3.9/site-packages/blurb.py", line 553, in load
    self.parse(text, metadata=metadata, filename=filename)
  File "/Users/jaraco/.local/pipx/venvs/blurb/lib/python3.9/site-packages/blurb.py", line 531, in parse
    throw("Blurb metadata sets " + repr(name) + " twice!")
  File "/Users/jaraco/.local/pipx/venvs/blurb/lib/python3.9/site-packages/blurb.py", line 486, in throw
    raise BlurbError(f("Error in {filename}:{line_number}:\n{s}"))
  File "/Users/jaraco/.local/pipx/venvs/blurb/lib/python3.9/site-packages/blurb.py", line 138, in f
    return s.format_map(d)
KeyError: 'filename'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions