Projet

Général

Profil

Tâche #35796

Scénario #35784: EOLE 2.10 : Traquer les warnings python dans le code EOLE

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

Ajouté par Joël Cuissinat il y a environ 2 mois. Mis à jour il y a 9 jours.

Statut:
Nouveau
Priorité:
Normal
Assigné à:
-
Version cible:
Début:
07/03/2024
Echéance:
% réalisé:

0%

Restant à faire (heures):

Description

  /usr/lib/python3/dist-packages/Cheetah/Template.py:25: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
    import cgi  # Used by .webInput() if the template is a CGI script.

python3-cheetah: /usr/lib/python3/dist-packages/Cheetah/Template.py
Hum, cette occurrence là ne vient pas de chez nous mais on en a peut-être dans d'autres projets...

Historique

#1 Mis à jour par Joël Cuissinat il y a environ 2 mois

  • Description mis à jour (diff)

#2 Mis à jour par Benjamin Bohard il y a 9 jours

La solution de remplacement proposée dans la documentation python n’est peut-être pas adaptée au cas de l’entête Accept avec plusieurs valeurs.
L’extraction via email.message.EmailMessage ne semble pas retenir toutes les valeurs.
La fonction werkzeug.http.parse_accept_header est beaucoup plus exploitable :

>>> import werkzeug
>>> import tornado
>>> h = tornado.httputil.HTTPHeaders()
>>> h.parse_line("Accept: text/html, application/xhtml+xml, application/xml;q=0.9, image/webp, */*;q=0.8")
>>> werkzeug.http.parse_accept_header("Accept: text/html, application/xhtml+xml, application/xml;q=0.9, image/webp, */*;q=0.8")
Accept([('Accept: text/html', 1), ('application/xhtml+xml', 1), ('image/webp', 1), ('application/xml', 0.9), ('*/*', 0.8)])

Formats disponibles : Atom PDF