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 form response file saving. Closes #7 #8

Closed
wants to merge 2 commits into from
Closed

Fix form response file saving. Closes #7 #8

wants to merge 2 commits into from

Conversation

CoolCat467
Copy link
Contributor

@CoolCat467 CoolCat467 commented Apr 18, 2023

As far as I understand it, Quart has this Request class that represents requests to the server. Inside this class, there is a class attribute form_data_parser_class. Currently it's left as FormDataParser, and that doesn't work because FormDataParser uses FileStorage, and FileStorage uses aiofiles, which is not compatible with Trio, so it all breaks.

This pull request adds new subclasses of the FormDataParser and FileStorage classes, named TrioFormDataParser and TrioFileStorage respectively, and the new TrioFileStorage class reimplements the save and load methods to use Trio's built in asynchronous file IO instead of using aiofiles.

Closes #7

@CoolCat467 CoolCat467 changed the title Fix form response file saving (Closes #7) Fix form response file saving. Closes #7 Apr 18, 2023
Removed instances of unbound `AnyStr` types and ignored override from quart app also having auto restart flag
@pgjones
Copy link
Owner

pgjones commented May 1, 2023

Thanks, I merged this manually as I've made some other updates beforehand.

@pgjones pgjones closed this May 1, 2023
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.

request.files[...].save() is not compatible with Trio
2 participants