You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
Traceback (most recent call last):
File "~/test.py", line 8, in <module>
with build('drive', 'v3', http=http) as service:
File "~/.venv/lib/python3.12/site-packages/googleapiclient/discovery.py", line 1422, in __exit__
self.close()
File "~/.venv/lib/python3.12/site-packages/googleapiclient/discovery.py", line 1429, in close
self._http.close()
^^^^^^^^^^^^^^^^
AttributeError: 'HttpMockSequence' object has no attribute 'close'
I think HttpMockSequence is just missing the close() method. TBH I just started using this library, but after a bunch of searching I think I'm using it as recommended, and I'm surprised that I'm the first to stumbled across this / report this.
Thanks for any help, and I'm happy to send a PR fixing the issue.
The text was updated successfully, but these errors were encountered:
parthea
added
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
priority: p2
Moderately-important priority. Fix may not be included in next release.
labels
Mar 28, 2024
priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
Environment details
google-api-python-client
version: Version: 2.122.0Steps to reproduce
Code example
Using build in a context manager is recommended by https://github.com/googleapis/google-api-python-client/blob/main/docs/start.md to ensure that service (and underlying http resources) are cleaned up.
Httplib2 has close() method that was added ~5 years ago.
Stack trace
I think HttpMockSequence is just missing the close() method. TBH I just started using this library, but after a bunch of searching I think I'm using it as recommended, and I'm surprised that I'm the first to stumbled across this / report this.
Thanks for any help, and I'm happy to send a PR fixing the issue.
The text was updated successfully, but these errors were encountered: