Projet

Général

Profil

Bug #41894

crash validation spf

Ajouté par Frédéric Péters il y a environ 4 ans. Mis à jour il y a environ 4 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Catégorie:
-
Version cible:
-
Début:
20 avril 2020
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Oui
Planning:
Non

Description

File "/usr/lib/python3/dist-packages/django/forms/fields.py" in clean
  161.         self.validate(value)

File "/usr/lib/python3/dist-packages/hobo/emails/forms.py" in validate
  27.         validate_email_spf(value)

File "/usr/lib/python3/dist-packages/hobo/emails/validators.py" in validate_email_spf
  59.         spf_records = [x for x in txt_records if x.startswith('v=spf1 ')]

File "/usr/lib/python3/dist-packages/hobo/emails/validators.py" in <listcomp>
  59.         spf_records = [x for x in txt_records if x.startswith('v=spf1 ')]

Exception Type: TypeError at /emails/
Exception Value: startswith first arg must be bytes or a tuple of bytes, not str

Fichiers


Demandes liées

Lié à Hobo - Bug #41906: TypeError: startswith first arg must be bytes or a tuple of bytes, not strFermé21 avril 2020

Actions

Révisions associées

Révision 22bbfcdb (diff)
Ajouté par Frédéric Péters il y a environ 4 ans

emails: handle DNS TXT entries as the bytes they are (#41894)

Historique

#2

Mis à jour par Frédéric Péters il y a environ 4 ans

Un peu réécrit parce que je n'ai pas trouvé bien claire cette ligne :

txt_records = sum([r.strings for r in dns.resolver.query(email_domain, 'TXT')], [])
#3

Mis à jour par Thomas Noël il y a environ 4 ans

  • Statut changé de Solution proposée à Solution validée

Le txt_records = [] dans le except peut être remplacé par un pass, à mon avis. Mais go, ça marche ainsi.

#4

Mis à jour par Frédéric Péters il y a environ 4 ans

  • Statut changé de Solution validée à Résolu (à déployer)

(j'ai mis le pass)

commit 22bbfcdb4463e96922cd33ca74e3b7adea68b83a
Author: Frédéric Péters <fpeters@entrouvert.com>
Date:   Mon Apr 20 17:57:36 2020 +0200

    emails: handle DNS TXT entries as the bytes they are (#41894)
#5

Mis à jour par Frédéric Péters il y a environ 4 ans

  • Statut changé de Résolu (à déployer) à Solution déployée
#6

Mis à jour par Christophe Siraut il y a environ 4 ans

  • Lié à Bug #41906: TypeError: startswith first arg must be bytes or a tuple of bytes, not str ajouté

Formats disponibles : Atom PDF