Skip to content

Receive warnings "ResourceWarning: unclosed file" when using googleapiclient.http.MediaFileUpload #575

@wangxf123456

Description

@wangxf123456

On google-api-python-client/googleapiclient/http.py:552, a file is opened. But this file is never closed. So I receive the following warning:

ResourceWarning: unclosed file <_io.BufferedReader name=<file_name> media_body = http.MediaFileUpload()

Metadata

Metadata

Assignees

Labels

🚨This issue needs some love.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.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions