Skip to content

Conversation

@darshanm17
Copy link

When users pass files using the Requests API format {'key': ('filename', fileobj, ...)}, the inner fileobj was not being closed by _close_file_descriptors.
This could lead to resource leaks in uploads.

  • Extend _close_file_descriptors to detect and close file objects inside file-tuple values.
  • Add unit test to verify the behavior.

When users pass files using the Requests API format
{'key': ('filename', fileobj, ...)}, the inner fileobj
was not being closed by _close_file_descriptors.
This could lead to resource leaks in uploads.

- Extend _close_file_descriptors to detect and close
  file objects inside file-tuple values.
- Add unit test to verify the behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant