Project

General

Profile

Tâche #31637

Scénario #31587: Traitement express MEN (05-07)

L'import d'un fichier "config.eol" n'est plus fonctionnel sur Zéphir 2.8

Added by Joël Cuissinat over 2 years ago. Updated over 2 years ago.

Status:
Fermé
Priority:
Normal
Assigned To:
Start date:
02/04/2021
Due date:
% Done:

100%

Remaining (hours):
0.0

Description

Problème remonté par le CD73 :

Après avoir upgradé le zephir en version 2.8.0, il n’est plus possible d’importer une configuration pour un nouveau serveur (2.8 ou autre) après avoir cliqué sur générer.
L’erreur retournée :
Impossible d'importer le fichier : Fichier non compatible (startswith first arg must be bytes or a tuple of bytes, not str)

C'est très facilement reproductible (NB : ajouter un test squash), voila le traceback dans les logs :

[2021-02-04 14:35:24,268] ERROR in zephir_views: Tentative d'import d'un fichier Creole2
[2021-02-04 14:35:24,269] ERROR in zephir_views: startswith first arg must be bytes or a tuple of bytes, not str
#011Traceback (most recent call last):
#011  File "/usr/lib/python3/dist-packages/zephir/web/zephirgenconfig/zephir_views.py", line 252, in upload_config_zephir
#011    f_values = json.load(eol_file.stream.read())
#011  File "/usr/lib/python3.8/json/__init__.py", line 293, in load
#011    return loads(fp.read(),
#011AttributeError: 'bytes' object has no attribute 'read'
#011
#011During handling of the above exception, another exception occurred:
#011
#011Traceback (most recent call last):
#011  File "/usr/lib/python3/dist-packages/zephir/web/zephirgenconfig/zephir_views.py", line 259, in upload_config_zephir
#011    old_conf.readfp(eol_file.stream, 'zephir_ini.eol')
#011  File "/usr/lib/python3.8/configparser.py", line 763, in readfp
#011    self.read_file(fp, source=filename)
#011  File "/usr/lib/python3.8/configparser.py", line 718, in read_file
#011    self._read(f, source)
#011  File "/usr/lib/python3.8/configparser.py", line 1033, in _read
#011    if line.strip().startswith(prefix):
#011TypeError: startswith first arg must be bytes or a tuple of bytes, not str


Related issues

Copied to Distribution EOLE - Scénario #31725: L'export d'un fichier "config.eol" n'est plus fonctionnel sur Zéphir 2.8 Terminé (Sprint) 03/01/2021 03/12/2021

Associated revisions

Revision babfb510 (diff)
Added by Joël Cuissinat over 2 years ago

Correction import/export de configuration

Ref: #31637

History

#1 Updated by Joël Cuissinat over 2 years ago

  • Tracker changed from Demande to Tâche
  • Status changed from Nouveau to En cours
  • Assigned To set to Joël Cuissinat
  • Parent task set to #31587

=> remplacer json.load par json.loads dans zephir_views.py

#2 Updated by Joël Cuissinat over 2 years ago

L'export plante également !

[2021-02-04 15:03:47,691] ERROR in zephir_views: dump() missing 1 required positional argument: 'fp'
#011Traceback (most recent call last):
#011  File "/usr/lib/python3/dist-packages/zephir/web/zephirgenconfig/zephir_views.py", line 332, in download_config_zephir
#011    json_config = json.dump(json_config)
#011TypeError: dump() missing 1 required positional argument: 'fp'

Là, ça devrait être dumps mais ça plante plus loin !
/usr/lib/python3/dist-packages/flask/helpers.py ?

#4 Updated by Joël Cuissinat over 2 years ago

L'export plante toujours mais le traceback semble indiquer que le problème est dans twisted

=> Nouveau scénario #31725

#5 Updated by Joël Cuissinat over 2 years ago

  • Copied to Scénario #31725: L'export d'un fichier "config.eol" n'est plus fonctionnel sur Zéphir 2.8 added

#6 Updated by Joël Cuissinat over 2 years ago

  • Status changed from En cours to Résolu
  • % Done changed from 0 to 100

#7 Updated by Fabrice Barconnière over 2 years ago

  • Status changed from Résolu to Fermé
  • Remaining (hours) set to 0.0

Also available in: Atom PDF