Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix validate.FileSize to handle SpooledTemporaryFile #300

Merged
merged 4 commits into from
Mar 18, 2024

Conversation

uncle-lv
Copy link
Contributor

@uncle-lv uncle-lv commented Mar 16, 2024

There was a big mistake caused by my carelessness!

The stream of FileStorage is not always BytesIO.
If we upload a file by HTTP clients, it may be a SpooledTemporaryFile. Then we get an error message: AttributeError: 'SpooledTemporaryFile' object has no attribute 'getbuffer'.

Please release it as soon as possible.

Sorry for this.

@sloria sloria enabled auto-merge (squash) March 18, 2024 19:06
@sloria sloria merged commit 31b476b into marshmallow-code:dev Mar 18, 2024
8 checks passed
@uncle-lv uncle-lv changed the title fix: fix _get_filestorage_size bug Fix validate.FileSize to handle SpooledTemporaryFile Mar 19, 2024
@uncle-lv uncle-lv deleted the fix-getsize-bug branch March 21, 2024 15:48
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.

2 participants