Opened at 2024-10-16T18:45:17Z
Closed at 2025-08-28T16:30:41Z
#4123 closed defect (fixed)
Tahoe-LAFS depends on removed `cgi` stdlib module
| Reported by: | cypher | Owned by: | itamarst |
|---|---|---|---|
| Priority: | normal | Milestone: | undecided |
| Component: | unknown | Version: | n/a |
| Keywords: | Cc: | ||
| Launchpad Bug: |
Description
Tahoe-LAFS' allmydata.webish module currently depends on cgi.FieldStorage from the Python standard library in order to "do terrible things to ensure files are still bytes".
The cgi module, however, was recently (as of Python 3.13) removed as part of the PEP-0594 initiative -- of "removing dead batteries from the standard library".
In order to provide compatibility with Python 3.13, then, a suitable cgi replacement module will need to be found and/or the dependent codepaths will need to be updated accordingly. (There may, of course, be other outstanding work/issues that further prevent Python 3.13 compatibility; this is just one such issue).
Change History (4)
comment:1 Changed at 2024-10-16T20:48:00Z by meejah
comment:2 Changed at 2024-11-05T19:19:24Z by itamarst
- Owner set to itamarst
comment:3 Changed at 2025-08-18T19:52:54Z by hacklschorsch
For the Debian package, we just added the cgi module back to the list of dependencies - it is now in a module. I forget whether we used https://pypi.org/project/legacy-cgi/ or https://pypi.org/project/standard-cgi/
comment:4 Changed at 2025-08-28T16:30:41Z by hacklschorsch
- Resolution set to fixed
- Status changed from new to closed
I fixed this by adding the legacy-cgi package to the dependency, as Andrius had done it for the Debian Trixie package. PR in https://github.com/tahoe-lafs/tahoe-lafs/pull/1444 .
Using the Twisted APIs might be slightly better, however that legacy-cgi package isn't in the way either.

I think what we should probably do is delete all the weird custom stuff, stop using the "cgi" module entirely and just rely on the Twisted APIs.