googleapis / google-api-python-client

🐍 The official Python client library for Google's discovery based APIs.
https://googleapis.github.io/google-api-python-client/docs/
Apache License 2.0
7.76k stars 2.41k forks source link

service object gives error on closing #1200

Closed dushyant-goel closed 3 years ago

dushyant-goel commented 3 years ago

New developer here. service.close() gives an error as detailed below.

Environment details

Steps to reproduce

  1. Follow Read Me, to first code snippet, where a service object is created.

Code example

# from googleapiclient.discovery import build
# service = build('youtube', 'v3')
# ...
# service.close()
Traceback (most recent call last):
  File "--.py", line --, in <module>
    service.close()
  File "/home/user/path/to/file/API/lib/python3.8/site-packages/googleapiclient/discovery.py", line 1335, in close
    self._http.http.close()
AttributeError: 'Http' object has no attribute 'http'
busunkim96 commented 3 years ago

Hi @Sunshine95,

Thanks for the report. I think https://github.com/googleapis/google-auth-library-python-httplib2/pull/14/ needs to be merged/released for this to be resolved. I'll work on getting that PR updated.

dushyant-goel commented 3 years ago

Dear Bu Sun Kim,

I am glad that you found it useful. I was worried about that my comment would be a faux pas.

Thank You Tony

On Tue, 23 Feb 2021, 21:20 Bu Sun Kim, notifications@github.com wrote:

Hi @Sunshine95 https://github.com/Sunshine95,

Thanks for the report. I think googleapis/google-auth-library-python-httplib2#14 https://github.com/googleapis/google-auth-library-python-httplib2/pull/14 needs to be merged/released for this to be resolved. I'll work on getting that PR updated.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/googleapis/google-api-python-client/issues/1200#issuecomment-784299376, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACLIFMN3JX46ZUCID4AM5E3TAPFCVANCNFSM4YASKDQQ .

busunkim96 commented 3 years ago

It turns out this is a duplicate of #1046, so closing this one to continue tracking on the older issue. I've updated https://github.com/googleapis/google-auth-library-python-httplib2/pull/14. The next version of google-auth-httplib2 (expected release next week) should fix the issue.