AttributeError: 'NoneType' object has no attribute 'status_code'
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.2k
- Forks
- 214
- PR merge metrics
- No merged PRs in 30d
Description
Given:
$ waybackpack --uniques-only --no-clobber --follow-redirects --ignore-errors -d StevenHarman 'http://feeds.stevenharman.net/stevenharman' --from-date=20090220053814
I get:
INFO:waybackpack.session: HTTP status code: 504
INFO:waybackpack.session: Waiting 1 second before retrying.
INFO:waybackpack.session: Waiting 1 second before retrying.
INFO:waybackpack.session: HTTP status code: 503
INFO:waybackpack.session: Waiting 1 second before retrying.
INFO:waybackpack.session: Waiting 1 second before retrying.
INFO:waybackpack.session: HTTP status code: 503
INFO:waybackpack.session: Waiting 1 second before retrying.
INFO:waybackpack.session: Waiting 1 second before retrying.
INFO:waybackpack.session: HTTP status code: 503
INFO:waybackpack.session: Waiting 1 second before retrying.
INFO:waybackpack.session: Maximum retries reached, skipping.
Traceback (most recent call last):
File "/opt/homebrew/bin/waybackpack", line 8, in <module>
sys.exit(main())
^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/waybackpack/cli.py", line 130, in main
snapshots = search(
^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/waybackpack/cdx.py", line 27, in search
if res.status_code == 200:
^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'status_code'
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
Start in waybackpack/cdx.py at search(), where the traceback accesses res.status_code, and inspect the retry behavior that reports “Maximum retries reached, skipping.” Reproduce the command with the shown URL and options, then verify that exhausting retries no longer causes an AttributeError and that the command handles the skipped request as intended.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100