GAM-team / got-your-back

Got Your Back (GYB) is a command line tool for backing up your Gmail messages to your computer using Gmail's API over HTTPS.
https://github.com/GAM-team/got-your-back/wiki
Apache License 2.0
2.6k stars 205 forks source link

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

Open centic9 opened 2 years ago

centic9 commented 2 years ago

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: <HttpError 403 when requesting https://gmail.googleapis.com/gmail/v1/users/me/messages/xxxxxxx?format=minimal&fields=id%2ClabelIds&alt=json returned "Quota exceeded for quota metric 'Queries' and limit 'Queries per minute per user' of service 'gmail.googleapis.com' for consumer 'project_number:123456789'.">

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "gyb.py", line 2761, in <module>
    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'