GAM-team / GAM-team/got-your-back

Invalid use of httplib2.error.ServerNotFoundError instead of httplib2.ServerNotFoundError

Open
#387 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
3.1k
Forks
245
PR merge metrics
No merged PRs in 30d

Description

When upgrading from 1.62 to 1.70 I get a new exception, stepping back to 1.62 makes it work again.

Looks like a simple typo after a quick look.

Full steps to reproduce the issue:
1. Run GYB on a Google Account
2. v1.62 works fine
3. v1.70 fails with exception below

**Simply replacing "httplib2.error.ServerNotFoundError" at line 757 with "httplib2.ServerNotFoundError" makes it work again.**

Expected outcome (what are you trying to do?):
`It works`

Actual outcome (what errors or bad behavior do you see instead?):

```
GYB needs to refresh 27768 messages
Traceback (most recent call last):
File "gyb.py", line 745, in callGAPI
return method.execute()
File "/usr/lib/python3/dist-packages/googleapiclient/_helpers.py", line 130, in positional_wrapper
return wrapped(*args, **kwargs)
File "/usr/lib/python3/dist-packages/googleapiclient/http.py", line 1493, in execute
callback(request_id, response, exception)
File "gyb.py", line 1659, in refresh_message
raise exception
File "/usr/lib/python3/dist-packages/googleapiclient/http.py", line 1487, in execute
raise HttpError(resp, content, uri=request.uri)
googleapiclient.errors.HttpError:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "gyb.py", line 2761, in
main(sys.argv[1:])
File "gyb.py", line 2120, in main
callGAPI(gbatch, None, soft_errors=True)
File "gyb.py", line 757, in callGAPI
httplib2.error.ServerNotFoundError) as e:
AttributeError: module 'httplib2' has no attribute 'error'
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Open gyb.py around line 757 and compare the referenced httplib2 exception with the traceback and the working 1.62 behavior. Reproduce the failure by running GYB against a Google Account, then verify that the refresh operation no longer raises the AttributeError and handles the reported server-not-found exception correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.