Bug #82998
accès à une donnée d'un bloc qui depuis a été supprimé
Début:
31 octobre 2023
Echéance:
% réalisé:
0%
Temps estimé:
Patch proposed:
Non
Planning:
Non
Description
Rencontrée dans #82989; actuellement ça va planter, parce que l'existence va être annoncée et au moment de l'accès le bloc ne sera plus là,
FileNotFoundError Traceback (most recent call last) /usr/lib/python3/dist-packages/wcs/qommon/storage.py in get_filename(cls, filename, ignore_errors, ignore_migration, **kwargs) 570 try: --> 571 fd = open(force_bytes(filename, 'utf-8'), 'rb') # pylint: disable=consider-using-with 572 o = cls.storage_load(fd, **kwargs) FileNotFoundError: [Errno 2] No such file or directory: b'/var/lib/wcs/.../blockdefs-slug/code_aeroport' During handling of the above exception, another exception occurred: KeyError Traceback (most recent call last) <ipython-input-13-acc60a4dd45f> in <module> ----> 1 fd.workflow_form.reservation[0].var.voyage_aeroport_depart.var /usr/lib/python3/dist-packages/wcs/variables.py in var(self) 1672 def var(self): 1673 # alias when there's a single item -> 1674 return self[0] 1675 1676 def __iter__(self): /usr/lib/python3/dist-packages/wcs/variables.py in __getitem__(self, key) 1657 data = self._formdata.data.get(self._field.id)['data'][int(key)] 1658 return LazyBlockDataVar( -> 1659 self._field.block.fields, 1660 data, 1661 formdata=self._formdata, /usr/lib/python3/dist-packages/wcs/fields/block.py in block(self) 127 if self._block: 128 return self._block --> 129 self._block = BlockDef.get_on_index(self.block_slug, 'slug') 130 return self._block 131 /usr/lib/python3/dist-packages/wcs/qommon/storage.py in get_on_index(cls, id, index, ignore_errors, ignore_migration) 537 cls.rebuild_indexes() 538 filename = os.path.join(index_dir, str(fix_key(id))) --> 539 return cls.get_filename(filename, ignore_errors=ignore_errors, ignore_migration=ignore_migration) 540 541 @classmethod /usr/lib/python3/dist-packages/wcs/qommon/storage.py in get_filename(cls, filename, ignore_errors, ignore_migration, **kwargs) 574 if ignore_errors: 575 return None --> 576 raise KeyError() 577 except ImportError: 578 if ignore_errors: KeyError:
Révisions associées
Historique
Mis à jour par Robot Gitea il y a 6 mois
- Statut changé de Nouveau à En cours
Frédéric Péters (fpeters) a ouvert une pull request sur Gitea concernant cette demande :
- URL : https://git.entrouvert.org/entrouvert/wcs/pulls/805
- Titre : WIP: misc: avoid crashes with variables pointing to deleted block (#82998)
- Modifications : https://git.entrouvert.org/entrouvert/wcs/pulls/805/files
Mis à jour par Robot Gitea il y a 6 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 :
Mis à jour par Robot Gitea il y a 6 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 :
- URL : https://git.entrouvert.org/entrouvert/wcs/pulls/805
- Titre : misc: avoid crashes with variables pointing to deleted block (#82998)
- Modifications : https://git.entrouvert.org/entrouvert/wcs/pulls/805/files
Mis à jour par Transition automatique il y a 6 mois
- Statut changé de Résolu (à déployer) à Solution déployée
misc: avoid crashes with variables pointing to deleted block (#82998)