Remove cgi.FieldStorage (based on #769) by scottbarnes · Pull Request #773 · webpy/webpy
| d = d.encode("utf-8") | ||
| fp = BytesIO(d) | ||
| a = cgiFieldStorage(fp=fp, environ=e, keep_blank_values=1) | ||
| post_data = data().decode("utf-8") |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just making sure we're not accidentally losing anything in this decode (or hitting any other unexpected results)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| return fs.value | ||
| env["REQUEST_METHOD"] = "GET" | ||
| b = dict( | ||
| urllib.parse.parse_qs(env.get("QUERY_STRING", ""), keep_blank_values=True) |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NB: QUERY_STRING previously handled within cgiFieldStorage constructor.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks, @tfmorris, @scottbarnes, @mekarpeles for the collaboration.
Monday Python 3.12 should ship.
One year from Monday Python 3.12 should ship and web.py should be ready. ;-)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This had been merged by the time I saw the ping requesting review, so I didn't bother, but circling back to do a post-hoc review now since there was an issue with it.
Comment on lines +427 to +428
| "_fieldstorage" | ||
| ) # TODO: Rename? is this visible anywhere else? |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually manipulated by the OpenLibrary code, as I remember. Instead of exposing this, nominally internal, name, a better method might be to introduce a clear_cache() function or some such to encapsulate this.
| d = d.encode("utf-8") | ||
| fp = BytesIO(d) | ||
| a = cgiFieldStorage(fp=fp, environ=e, keep_blank_values=1) | ||
| post_data = data().decode("utf-8") |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was referenced
Apr 29, 2024This file contains hidden or 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