Projet

Général

Profil

Bug #86331

TypeError sur |rename_file appelé sur un fifchier avec base_filename et orig_filename à None

Ajouté par Frédéric Péters il y a 3 mois. Mis à jour il y a 3 mois.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Version cible:
-
Début:
30 janvier 2024
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Non
Planning:
Non

Description

[2024-01-30 15:29:11] exception caught
Exception:
  type = '<class 'TypeError'>', value = 'expected str, bytes or os.PathLike object, not NoneType'

Stack trace (most recent call first):
  File "/usr/lib/python3.9/posixpath.py", line 118, in splitext
   116
   117 def splitext(p):
>  118     p = os.fspath(p)
   119     if isinstance(p, bytes):
   120         sep = b'/'

  locals:
     p = None

  File "/usr/lib/python3/dist-packages/wcs/qommon/templatetags/qommon.py", line 1075, in rename_file
  1073         return None
  1074     if new_name.endswith('.$ext'):
> 1075         new_name = os.path.splitext(new_name)[0] + os.path.splitext(file_object.base_filename)[1]
  1076     file_object.orig_filename = new_name
  1077     file_object.base_filename = new_name

  locals:
     FileField = <class 'wcs.fields.file.FileField'>
     file_object = <PicklableUpload at 7f9d363603d0: None>
     new_name = 'none.$ext'
     value = <wcs.variables.LazyFieldVarFile object at 0x7f9d36360340>

Révisions associées

Révision 37c5f7d6 (diff)
Ajouté par Frédéric Péters il y a 3 mois

misc: let |rename_file works with missing source filename (#86331)

Historique

#2

Mis à jour par Robot Gitea il y a 3 mois

  • Statut changé de Nouveau à En cours
  • Assigné à mis à Frédéric Péters

Frédéric Péters (fpeters) a lié une pull request sur Gitea concernant cette demande :

#3

Mis à jour par Frédéric Péters il y a 3 mois

  • Statut changé de En cours à Solution proposée
#4

Mis à jour par Robot Gitea il y a 3 mois

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

Lauréline Guérin (lguerin) a approuvé une pull request sur Gitea concernant cette demande :

#5

Mis à jour par Robot Gitea il y a 3 mois

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

Frédéric Péters (fpeters) a mergé une pull request sur Gitea concernant cette demande :

#6

Mis à jour par Transition automatique il y a 3 mois

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

Mis à jour par Transition automatique il y a 22 jours

Automatic expiration

Formats disponibles : Atom PDF