-
Notifications
You must be signed in to change notification settings - Fork 571
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support custom filename to be provided to URLFile (#2004)
This commit works around an issue where the basename of the URL many not actually contain a file extension and the uploader logic cannot infer the mime type for the file. We stash the name when pickling and extract it again when unpickling. The __getattr__ function then supports returning the underlying name value rather than proxying to the underlying request object. I also ran into a small bug whereby the __del__ method was triggering a network request because of some private attributes being accessed during teardown would trigger the __wrapper__ code. I've overridden the super class to disable this. Though I'm unclear if this is just the test suite doing this cleanup.
- Loading branch information
Showing
2 changed files
with
47 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters