Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #15981 > unrolled thread

Simple module for python-based cgi?

Started bySamuel Thibault <sthibault@debian.org>
First post2024-06-29 22:10 +0200
Last post2024-06-29 23:50 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.debian.maint.python


Contents

  Simple module for python-based cgi? Samuel Thibault <sthibault@debian.org> - 2024-06-29 22:10 +0200
    Re: Simple module for python-based cgi? Fay Stegerman <flx@obfusk.net> - 2024-06-29 22:30 +0200
    Re: Simple module for python-based cgi? eevelweezel <eevel.weezel@gmail.com> - 2024-06-29 23:50 +0200

#15981 — Simple module for python-based cgi?

FromSamuel Thibault <sthibault@debian.org>
Date2024-06-29 22:10 +0200
SubjectSimple module for python-based cgi?
Message-ID<IUMhM-6vXu-1@gated-at.bofh.it>
Hello,

I used to use the cgi module to implement simple python-based cgi
scripts for mere http forms. But it is getting deprecated
https://peps.python.org/pep-0594/#cgi
and concerning form support:

  FieldStorage/MiniFieldStorage has no direct replacement,
  but can typically be replaced by using multipart
  (https://pypi.org/project/multipart/) (for POST and PUT requests) or
  urllib.parse.parse_qsl (for GET and HEAD requests)

But that multipart project doesn't seem to be packaged in Debian?
(python-multipart seems to be something else, that doesn't seem to
actually provide form content?)

Do we actually have something in Debian python to replace cgi's
FieldStorage in a simple way?

Samuel

[toc] | [next] | [standalone]


#15983

FromFay Stegerman <flx@obfusk.net>
Date2024-06-29 22:30 +0200
Message-ID<IUMRQ-6wrY-21@gated-at.bofh.it>
In reply to#15981
* Samuel Thibault <sthibault@debian.org> [2024-06-29 21:46]:
> I used to use the cgi module to implement simple python-based cgi
> scripts for mere http forms. But it is getting deprecated
> https://peps.python.org/pep-0594/#cgi
> and concerning form support:
> 
>   FieldStorage/MiniFieldStorage has no direct replacement,
>   but can typically be replaced by using multipart
>   (https://pypi.org/project/multipart/) (for POST and PUT requests) or
>   urllib.parse.parse_qsl (for GET and HEAD requests)
> 
> But that multipart project doesn't seem to be packaged in Debian?
> (python-multipart seems to be something else, that doesn't seem to
> actually provide form content?)
> 
> Do we actually have something in Debian python to replace cgi's
> FieldStorage in a simple way?

I haven't used it myself so I'm not sure it would fit your use case, and it
might not exactly count as "simple", but Debian does have
python3-requests-toolbelt which seems to provide a
requests_toolbelt.multipart.decoder.MultipartDecoder.

- Fay

[toc] | [prev] | [next] | [standalone]


#15984

Fromeevelweezel <eevel.weezel@gmail.com>
Date2024-06-29 23:50 +0200
Message-ID<IUO7f-6x9k-3@gated-at.bofh.it>
In reply to#15981

[Multipart message — attachments visible in raw view] — view raw

If you are looking for something in the stdlib, I believe the
recommendation is to use email.message.

On Sat, Jun 29, 2024, 12:47 Samuel Thibault <sthibault@debian.org> wrote:

> Hello,
>
> I used to use the cgi module to implement simple python-based cgi
> scripts for mere http forms. But it is getting deprecated
> https://peps.python.org/pep-0594/#cgi
> and concerning form support:
>
>   FieldStorage/MiniFieldStorage has no direct replacement,
>   but can typically be replaced by using multipart
>   (https://pypi.org/project/multipart/) (for POST and PUT requests) or
>   urllib.parse.parse_qsl (for GET and HEAD requests)
>
> But that multipart project doesn't seem to be packaged in Debian?
> (python-multipart seems to be something else, that doesn't seem to
> actually provide form content?)
>
> Do we actually have something in Debian python to replace cgi's
> FieldStorage in a simple way?
>
> Samuel
>
>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.maint.python


csiph-web