From ee8cfc619149237961f88cafa54f5f76972f9a9e Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 21 Apr 2022 20:48:38 +0200 Subject: [PATCH] msg erreur apo_compare_csv --- app/scodoc/sco_apogee_compare.py | 12 +++++++++--- sco_version.py | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/scodoc/sco_apogee_compare.py b/app/scodoc/sco_apogee_compare.py index 86e2f334b..b6cb042b2 100644 --- a/app/scodoc/sco_apogee_compare.py +++ b/app/scodoc/sco_apogee_compare.py @@ -272,9 +272,15 @@ def _build_etud_res(e, apo_data): r = {} for elt_code in apo_data.apo_elts: elt = apo_data.apo_elts[elt_code] - col_ids_type = [ - (ec["apoL_a01_code"], ec["Type R\xc3\xa9s."]) for ec in elt.cols - ] # les colonnes de cet élément + try: + # les colonnes de cet élément + col_ids_type = [ + (ec["apoL_a01_code"], ec["Type R\xc3\xa9s."]) for ec in elt.cols + ] + except KeyError as exc: + raise ScoValueError( + "Erreur: un élément sans 'Type R\xc3\xa9s.'. Vérifiez l'encodage de vos fichiers." + ) from exc r[elt_code] = {} for (col_id, type_res) in col_ids_type: r[elt_code][type_res] = e.cols[col_id] diff --git a/sco_version.py b/sco_version.py index 24931a73b..06ddcfb8e 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.2.7" +SCOVERSION = "9.2.8" SCONAME = "ScoDoc"