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

cgi is deprecated as of Python 3.11 #355

Closed
twm opened this issue Sep 6, 2022 · 2 comments · Fixed by #377
Closed

cgi is deprecated as of Python 3.11 #355

twm opened this issue Sep 6, 2022 · 2 comments · Fixed by #377

Comments

@twm
Copy link
Contributor

twm commented Sep 6, 2022

There are two uses of the cgi module in treq:

  1. One use of cgi.parse_header() in treq.contentsuggested replacement is email.message.Message
  2. One use of cgi.parse_multipart() in treq.test.test_multipart — same suggested replacement
@cjwatson
Copy link

cjwatson commented Sep 6, 2022

For cgi.parse_multipart, treq is likely to be better off using the multipart module from PyPI. email.message is often not quite right for HTTP form data, despite the similar encoding.

@adiroiban
Copy link
Member

Does multipart support non-blocking API?
I took a very quick look at the code and I don't see any callback/non-blocking support. Maybe I need to dig deeper.


I have this code that I am using in prod for my app https://gist.github.com/adiroiban/7f593d6d18113aae797ad081e07f4745 ... but this uses a fork of twisted web with support for replacing the custom content handler

If anyone is interested, I am happy to get something based on this code into twisted ... I also have tests for it.. but have not added them in the gist.

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 a pull request may close this issue.

3 participants