simon-budig / woof

an ad-hoc single file webserver
119 stars 16 forks source link

DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13 #19

Open gritstub opened 1 year ago

gritstub commented 1 year ago

Using woof on Python 3.11+ now throws this warning every time:

woof:30: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
  import cgi, urllib.request, urllib.parse, http.server

The Python documentation on cgi recommends:

Deprecated since version 3.11, will be removed in version 3.13: The cgi module is deprecated (see PEP 594 for details and alternatives).

The FieldStorage class can typically be replaced with urllib.parse.parse_qsl() for GET and HEAD requests, and the email.message module or multipart for POST and PUT. Most utility functions have replacements.