Bug #26183
stockage d'un mot de passe non-ascii ne mode "cleartext" : crash UnicodeDecodeError
Statut:
Rejeté
Priorité:
Normal
Assigné à:
-
Version cible:
-
Début:
06 septembre 2018
Echéance:
% réalisé:
0%
Temps estimé:
Patch proposed:
Non
Planning:
Description
Exception: type = '<type 'exceptions.UnicodeDecodeError'>', value = ''ascii' codec can't decode byte 0xc3 in position 0: ordinal not in range(128)' Stack trace (most recent call first): File "/usr/lib/python2.7/dist-packages/wcs/sql.py", line 1075, in get_sql_dict_from_data 1073 if field.key in ('ranked-items', 'password'): 1074 # turn {'poire': 2, 'abricot': 1, 'pomme': 3} into an array > 1075 value = [[x, unicode(y).encode('utf-8')] for x, y in value.items()] 1076 elif sql_type == 'varchar': 1077 assert isinstance(value, basestring) locals: data = {'200': {'cleartext': '\xc3\xa8\xc3\xa8\xc3\xa9\xc3\xa7"'}, 'future_tracking_code': '...', '208': '...', 'draft_formdata_id': 166} field = <wcs.fields.PasswordField object at 0x7fa163b9ba50> formdef = <FormDef 'xxx' id:n> sql_dict = {'f208': '...'} sql_type = 'text[][]' value = {'cleartext': '\xc3\xa8\xc3\xa8\xc3\xa9\xc3\xa7"'} x = 'cleartext' y = '\xc3\xa8\xc3\xa8\xc3\xa9\xc3\xa7"'