xyou365 / AutoRclone

AutoRclone: rclone copy/move/sync (automatically) with thousands of service accounts

Home Page:https://www.gfan.loan/?p=235

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AttributeError: 'Http' object has no attribute 'close'

Enf0 opened this issue · comments

commented

When trying to generate service accounts, I get the following error:

# python3 gen_sa_accounts.py --quick-setup 1
Traceback (most recent call last):
  File "gen_sa_accounts.py", line 311, in <module>
    resp = serviceaccountfactory(
  File "gen_sa_accounts.py", line 178, in serviceaccountfactory
    cloud = build('cloudresourcemanager', 'v1', credentials=creds)
  File "/usr/local/lib/python3.8/dist-packages/googleapiclient/_helpers.py", line 134, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/googleapiclient/discovery.py", line 300, in build
    discovery_http.close()
AttributeError: 'Http' object has no attribute 'close'

Any idea why? Thanks.

commented

Same for me:

Traceback (most recent call last):
  File "gen_sa_accounts.py", line 311, in <module>
    resp = serviceaccountfactory(
  File "gen_sa_accounts.py", line 178, in serviceaccountfactory
    cloud = build('cloudresourcemanager', 'v1', credentials=creds)
  File "/usr/local/lib/python3.8/dist-packages/googleapiclient/_helpers.py", line 134, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/googleapiclient/discovery.py", line 300, in build
    discovery_http.close()
AttributeError: 'Http' object has no attribute 'close'
commented

Seems to be a bug in the lastest version (1.12.2) of googleapis/google-api-python-client according to this and this issue.

I solved it by manually installing 1.12.1 instead:
pip3 install google-api-python-client==1.12.1

Guys, did you update your httplib2 to the last version as well?
I have not tested on my side the last google api python client, but I am aware the last version makes use of close() method of http object from httplib2.
I don't know when this method was added, but maybe it was not existing with the version of httplib2 you are using.
Bests

AttributeError: 'Resource' object has no attribute 'close'.

The problem does persist

AttributeError: 'Resource' object has no attribute 'close'.

The problem does persist

yes, me too