simon-budig / woof

an ad-hoc single file webserver
120 stars 17 forks source link

Stop using depreciated `cgi` module #21

Open CoolCat467 opened 1 year ago

CoolCat467 commented 1 year ago

This PR replaces the depreciated cgi module's multipart form data decoding with the multipart form data decoding using the email module.

Along the way I also changed opening file objects to use with statements and added <DOCTYPE html> tags to multiple pages.

Closes #19

dereckson commented 3 weeks ago

Thanks for this pull request @CoolCat467

I've did the following tests and all seem to work:

This change has been adopted as a patch by HomeBrew maintainer and seems stable on macOS too.

I'd like a Python 3.13 version, so I'm going to maintain a fork and adopting your change too: https://devcentral.nasqueron.org/D3536

CoolCat467 commented 3 weeks ago

While you are at it, take a look at https://github.com/CoolCat467/dotfiles/blob/main/dotfiles/.bin/woof, I added type annotations and overall modernized the project.

dereckson commented 3 weeks ago

While you are at it, take a look at https://github.com/CoolCat467/dotfiles/blob/main/dotfiles/.bin/woof, I added type annotations and overall modernized the project.

This is indeed welcome, but I guess the discussion its out of scope of this cgi pull request. Ping me on Libera.chat if you use IRC, we can coordinate on that.