PEP 594: Removing dead batteries from the standard library

As the maintainer of WebOb, I am unhappy to see the deprecation/removal of cgi, especially since it seems that there has been a complete disregard for functionality that is still used by others. cgi.FieldStorage is used to parse POST data, and backs all file storage inside WebOb.

As I understand it there are other frameworks that use it as well, such as Bottle.

cgi.parse_header is also used by Django and WebOb.

cgi.parse_multipart is used by Twisted.


I already carry a fix for cgi.FieldStorage in WebOb due to a bug that has not yet been fixed in Python, but I would really prefer not to carry the whole of cgi.FieldStorage by vendoring it into WebOb, and then having multiple people implement the same standards. If this PEP goes through and cgi.FieldStorage are not moved then anyone that is parsing multipart POST bodies will have to write their own, or copy an older version and hope they can get patches from other projects that have done the same.

6 Likes