Bug in WARCRecord.__repr__()
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
Research direction
Start by reproducing the shown WARCHeader/WARCRecord snippet and reading init.py at WARCRecord.repr, WARCRecord.getitem, and WARCHeader.getitem. Determine whether the lookup chain or repr is responsible; done means the shown r expression produces a representation without the reported KeyError.
Written by the indexing model from the issue text.
Description
The line in repr:
return "<WARCRecord: type=%r record_id=%s>" % (self['type'], self['record_id'])
results in an error. I don't know if the above line is wrong or whether there's a bug in how the attribute lookup chain is supposed to work. Changing the above line to this works though:
return "<WARCRecord: type=%r record_id=%s>" % (self.header.type, self.header.record_id)
Traceback below.
h=WARCHeader({"WARC-Type": "response"}, defaults=True)
r = WARCRecord(h)
r
Traceback (most recent call last):
File "", line 1, in
File "init.py", line 186, in repr
return "<WARCRecord: type=%r record_id=%s>" % (self['type'], self['record_id'])
File "init.py", line 172, in getitem
return self.header[name]
File "init.py", line 40, in getitem
return self._d[name.lower()]
KeyError: 'type'
- Dominant language
- Python
- Stars
- 251
- Forks
- 114
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from internetarchive/warc
-
WARC: from_response incompatible with Requests>=1.0.0Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 1/5 Under an hour Newbie friendliness 68/100
internetarchive/warc#13 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
internetarchive/warc#36 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
internetarchive/warc#34 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 20/100
internetarchive/warc#32 · 3 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
internetarchive/warc#30 ·
All issues in internetarchive/warc
Similar issues
-
[Bug]: streaming_end_of_stream_only guardrails rescan the whole stream on every chunk - blocks event loopPossibly taken A pull request linked to this issue is open or already merged. Openbug llm translation
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
arith ascend bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
tile-ai/tilelang#5173 · 2 comments · 1 reaction ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
lanl/text-fetch#92 ·
Maintainers usually reply within 1 day
-
kind: for-triage
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
monumental-archive/.github#2284 ·
Maintainers usually reply within 1 day
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
TanbirRamim/open-source-radar#761 ·
Maintainers usually reply within 1 day