Development #31570
erreur lors de l'import d'un tableur contenant un formule de concatenation d'une chaîne unicode avec la valeur d'une autre cellule
Statut:
Fermé
Priorité:
Normal
Assigné à:
-
Version cible:
-
Début:
19 mars 2019
Echéance:
% réalisé:
0%
Temps estimé:
Patch proposed:
Non
Planning:
Non
Description
Avec l'exemple de fichier.
Django Version: 1.11.20 Python Version: 2.7.14 Installed Applications: '' Installed Middleware: '' Traceback: File "/home/serghei/sandbox/venvs/publik-env/local/lib/python2.7/site-packages/django/core/handlers/exception.py" in inner 41. response = get_response(request) File "/home/serghei/sandbox/venvs/publik-env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _legacy_get_response 249. response = self._get_response(request) File "/home/serghei/sandbox/venvs/publik-env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response 187. response = self.process_exception_by_middleware(e, request) File "/home/serghei/sandbox/venvs/publik-env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response 185. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/home/serghei/sandbox/venvs/publik-env/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view 23. return view_func(request, *args, **kwargs) File "/home/serghei/sandbox/venvs/publik-env/local/lib/python2.7/site-packages/django/views/generic/base.py" in view 68. return self.dispatch(request, *args, **kwargs) File "/home/serghei/dev/passerelle/passerelle/views.py" in dispatch 137. request, *args, **kwargs) File "/home/serghei/sandbox/venvs/publik-env/local/lib/python2.7/site-packages/django/views/generic/base.py" in dispatch 88. return handler(request, *args, **kwargs) File "/home/serghei/sandbox/venvs/publik-env/local/lib/python2.7/site-packages/django/views/generic/edit.py" in post 217. return super(BaseCreateView, self).post(request, *args, **kwargs) File "/home/serghei/sandbox/venvs/publik-env/local/lib/python2.7/site-packages/django/views/generic/edit.py" in post 183. return self.form_valid(form) File "/home/serghei/dev/passerelle/passerelle/views.py" in form_valid 160. response = super(GenericCreateConnectorView, self).form_valid(form) File "/home/serghei/sandbox/venvs/publik-env/local/lib/python2.7/site-packages/django/views/generic/edit.py" in form_valid 162. self.object = form.save() File "/home/serghei/dev/passerelle/passerelle/forms.py" in save 24. return super(GenericConnectorForm, self).save(commit=commit) File "/home/serghei/sandbox/venvs/publik-env/local/lib/python2.7/site-packages/django/forms/models.py" in save 468. self.instance.save() File "/home/serghei/dev/passerelle/passerelle/apps/csvdatasource/models.py" in save 161. self.cache_data() File "/home/serghei/dev/passerelle/passerelle/apps/csvdatasource/models.py" in cache_data 171. for block in batch(enumerate(self.get_rows()), 5000): File "/home/serghei/dev/passerelle/passerelle/apps/csvdatasource/models.py" in get_rows 222. content = get_data_ods(self.csv_file) File "/home/serghei/sandbox/venvs/publik-env/local/lib/python2.7/site-packages/pyexcel_ods/__init__.py" in get_data 37. return read_data(afile, file_type=file_type, **keywords) File "/home/serghei/sandbox/venvs/publik-env/local/lib/python2.7/site-packages/pyexcel_io/io.py" in get_data 71. afile, file_type=file_type, streaming=False, **keywords File "/home/serghei/sandbox/venvs/publik-env/local/lib/python2.7/site-packages/pyexcel_io/io.py" in _get_data 89. return load_data(**keywords) File "/home/serghei/sandbox/venvs/publik-env/local/lib/python2.7/site-packages/pyexcel_io/io.py" in load_data 191. reader.open_stream(file_stream, **keywords) File "/home/serghei/sandbox/venvs/publik-env/local/lib/python2.7/site-packages/pyexcel_ods/odsr.py" in open_stream 120. self._load_from_memory() File "/home/serghei/sandbox/venvs/publik-env/local/lib/python2.7/site-packages/pyexcel_ods/odsr.py" in _load_from_memory 160. self._native_book = load(self._file_stream) File "/home/serghei/sandbox/venvs/publik-env/local/lib/python2.7/site-packages/odf/opendocument.py" in load 972. __loadxmlparts(z, manifest, doc, u'') File "/home/serghei/sandbox/venvs/publik-env/local/lib/python2.7/site-packages/odf/opendocument.py" in __loadxmlparts 899. parser.parse(inpsrc) File "/usr/lib/python2.7/xml/sax/expatreader.py" in parse 111. xmlreader.IncrementalParser.parse(self, source) File "/usr/lib/python2.7/xml/sax/xmlreader.py" in parse 123. self.feed(buffer) File "/usr/lib/python2.7/xml/sax/expatreader.py" in feed 220. self._parser.Parse(data, isFinal) File "/usr/lib/python2.7/xml/sax/expatreader.py" in start_element_ns 373. AttributesNSImpl(newattrs, qnames)) File "/home/serghei/sandbox/venvs/publik-env/local/lib/python2.7/site-packages/odf/load.py" in startElementNS 79. e = Element(qname = tag, qattributes=attrdict, check_grammar=False) File "/home/serghei/sandbox/venvs/publik-env/local/lib/python2.7/site-packages/odf/element.py" in __init__ 376. self.setAttrNS(attr[0], attr[1], value) File "/home/serghei/sandbox/venvs/publik-env/local/lib/python2.7/site-packages/odf/element.py" in setAttrNS 507. self.attributes[(namespace, localpart)] = c.convert((namespace, localpart), value, self) File "/home/serghei/sandbox/venvs/publik-env/local/lib/python2.7/site-packages/odf/attrconverters.py" in convert 1608. return conversion(attribute, value, element) File "/home/serghei/sandbox/venvs/publik-env/local/lib/python2.7/site-packages/odf/attrconverters.py" in cnv_formula 120. return __save_prefix(attribute, arg, element) File "/home/serghei/sandbox/venvs/publik-env/local/lib/python2.7/site-packages/odf/attrconverters.py" in __save_prefix 112. return str(arg) Exception Type: UnicodeEncodeError at /manage/csvdatasource/add Exception Value: 'ascii' codec can't encode character u'\xe9' in position 6: ordinal not in range(128)
Fichiers
Historique
Mis à jour par Valentin Deniaud il y a plus de 4 ans
C'est de la faute de pyexcel-ods
. Je l'ai mis à jour pour voir, la dernière version ne marche pas non plus. Par contre en python3, tout baigne.
Vu que ce ticket a 7 mois, peut-être qu'on peut en attendre quelques uns de plus, le problème se résoudra tout seul quand passerelle tournera en py3...
Mis à jour par Valentin Deniaud il y a environ 4 ans
- Statut changé de Nouveau à Fermé
Je confirme qu'il n'y a plus de crash maintenant que combo tourne en python 3.