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

[BUG] AttributeError: 'str' object has no attribute 'exceptions' #66

Closed
yubiuser opened this issue Dec 11, 2023 · 6 comments
Closed

[BUG] AttributeError: 'str' object has no attribute 'exceptions' #66

yubiuser opened this issue Dec 11, 2023 · 6 comments

Comments

@yubiuser
Copy link

yubiuser commented Dec 11, 2023

Version 3.17.1, httpx installed, requests not installed.
Note: a lot of other 304 are handled correctly.

2023-12-11 12:13:58,332 handler[140522390620984] INFO: Job 15: https://piunikaweb.com/2022/08/08/google-pixel-6-6-pro-new-updates-bugs-issues-problems-tracker/ started processing (UrlJob)
Traceback (most recent call last):
  File "webchanges/handler.py", line 180, in process
2023-12-11 12:13:58,333 jobs[140522390620984] INFO: Job 15: Sending GET request to https://piunikaweb.com/2022/08/08/google-pixel-6-6-pro-new-updates-bugs-issues-problems-tracker/
2023-12-11 12:13:58,333 jobs[140522390620984] INFO: Job 15: Using the HTTPX HTTP client library with HTTP/2 support
  File "webchanges/jobs.py", line 941, in retrieve
  File "webchanges/jobs.py", line 696, in _retrieve_httpx
webchanges.jobs.NotModifiedError: 304

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "webchanges/handler.py", line 195, in process
  File "webchanges/jobs.py", line 978, in format_error
AttributeError: 'str' object has no attribute 'exceptions'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "webchanges.py", line 4, in <module>
  File "webchanges/cli.py", line 375, in main
  File "webchanges/command.py", line 1076, in run
  File "webchanges/main.py", line 98, in run_jobs
  File "webchanges/worker.py", line 211, in run_jobs
  File "webchanges/worker.py", line 87, in job_runner
  File "concurrent/futures/_base.py", line 619, in result_iterator
  File "concurrent/futures/_base.py", line 317, in _result_or_cancel
  File "concurrent/futures/_base.py", line 456, in result
  File "concurrent/futures/_base.py", line 401, in __get_result
  File "concurrent/futures/thread.py", line 58, in run
  File "webchanges/worker.py", line 88, in <lambda>
  File "webchanges/handler.py", line 206, in process
  File "webchanges/jobs.py", line 978, in format_error
AttributeError: 'str' object has no attribute 'exceptions'
[236] Failed to execute script 'webchanges' due to unhandled exception!

@yubiuser
Copy link
Author

Interestingly, running webchanges --errors does not error (and results in 200 than 304 http return code).

2023-12-11 12:20:58,832 handler[140180533103416] INFO: Job 15: https://piunikaweb.com/2022/08/08/google-pixel-6-6-pro-new-updates-bugs-issues-problems-tracker/ started processing (UrlJob)
2023-12-11 12:20:58,833 jobs[140180533103416] INFO: Job 15: Sending GET request to https://piunikaweb.com/2022/08/08/google-pixel-6-6-pro-new-updates-bugs-issues-problems-tracker/
2023-12-11 12:20:58,833 jobs[140180533103416] INFO: Job 15: Using the HTTPX HTTP client library with HTTP/2 support
....
2023-12-11 12:21:03,305 _client[140180533103416] INFO: HTTP Request: GET https://piunikaweb.com/2023/10/16/google-pixel-6-6-pro-new-updates-bugs-issues-problems-tracker/ "HTTP/2 200 OK"

@mborsetti
Copy link
Owner

mborsetti commented Dec 11, 2023

Thanks and apologies; fixed in 3.17.2.

I did run the tests after manually uninstalling requests and they now all passed, so hopefully this is the last bug.

Once again, thank you for your patience and for reporting these errors; I learned that legacy testing installing all libraries at once is a problem that needs to be fixed in the future!

PS --errors ignores all cached content (whose logic leads a website to respond with an [304 Not Modified] in case it does not change since the last snapshot). This can be improved, so thanks for noticing it and reporting it.

@yubiuser
Copy link
Author

Thanks. Fixed the issue for me.

@drws
Copy link

drws commented Feb 18, 2024

I'm getting this with v3.17.2 and it seems related:

AttributeError: 'str' object has no attribute 'Client'

During handling of the above exception, another exception occurred:

AttributeError: 'str' object has no attribute 'RequestError'

@mborsetti
Copy link
Owner

@drws,

Thanks for the report and sorry for the issue.

I think I found the issue even with the limited information, and released version 3.18.

Could you please check and let me know if this solved your issue? If not, kindly open a new bug report with the full traceback.

@drws
Copy link

drws commented Mar 1, 2024

The bug went away even before upgrade and I was unable to reproduce it again. The same after updating to 3.18 and 3.19. Unfortunately and even with a late answer I don't have any better information. Will open a new issue if something comes up.

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

3 participants