Project

General

Profile

Development #37218

crash import formulaire 'NoneType' object has no attribute 'encode' (e.text.encode(charset))

Added by Thomas Noël 4 months ago. Updated 26 days ago.

Status:
Solution déployée
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
25 Oct 2019
Due date:
% Done:

0%

Patch proposed:
No
Planning:
No

Description

Exception:
  type = '<type 'exceptions.AttributeError'>', value = ''NoneType' object has no attribute 'encode''

Stack trace (most recent call first):
  File "/usr/lib/python2.7/dist-packages/wcs/fields.py", line 281, in init_with_xml
   279                     v = {}
   280                     for e in el:
>  281                         v[e.tag] = e.text.encode(charset)
   282                 else:
   283                     print('currently:', self.__dict__)

  locals:
     attribute = 'data_source'
     charset = 'utf-8'
     e = <Element 'type' at 0x7ff91ea47690>
     el = <Element 'data_source' at 0x7ff91ea47550>
     elem = <Element 'field' at 0x7ff91ea47250>
     include_id = True
     self = <StringField None 'Nom de la rue'>
     v = {}
     x = <Element 'display_location' at 0x7ff91ea47190>

  File "/usr/lib/python2.7/dist-packages/wcs/fields.py", line 778, in init_with_xml
   776
   777     def init_with_xml(self, element, charset, include_id=False):
>  778         super(StringField, self).init_with_xml(element, charset, include_id=include_id)
   779         self.migrate()
   780

History

#1 Updated by Thomas Noël 4 months ago

Mais je n'ai pas le xml tenté, donc pas bien facile de voir.

#2 Updated by Frédéric Péters 26 days ago

  • Status changed from Nouveau to Solution déployée

A priori traité de manière globale dans #39240.

Also available in: Atom PDF