• [^] # Re: int vers string, entier vers chaîne

    Posté par . En réponse au message (débutant) Comment corriger une erreur unicode bébête et classique ?. Évalué à 2.

    Effectivement c'est un beau mélange !
    J'ai fait (à force de bricoler je finis par comprendre un peu Python):

    type_msg = key, vads_values[key], type(vads_values[key])
    _logger.error(type_msg)

    et ça donne :

    ('crap_action_mode', 'INTERACTIVE', <type 'str'>)
    ('crap_amount', 7490, <type 'int'>)
    ('crap_contrib', 'Odoo10_0.9.1/10.0-20170414', <type 'str'>)
    ('crap_ctx_mode', 'TEST', <type 'str'>)
    ('crap_crapoto', 978, <type 'int'>)
    ('crap_cust_address', 'b\xc3\xa9po', <type 'str'>)
    ('crap_cust_city', 'b\xc3\xa9po', <type 'str'>)
    ('crap_cust_country', u'FR', <type 'unicode'>)
    ('crap_cust_email', 'postmaster@alternatif.org', <type 'str'>)
    ('crap_cust_first_name', '', <type 'str'>)
    ('crap_cust_last_name', 'b\xc3\xa9po', <type 'str'>)
    ('crap_cust_name', 'b\xc3\xa9po', <type 'str'>)
    ('crap_cust_phone', '123', <type 'str'>)
    ('crap_cust_state', '', <type 'str'>)
    ('crap_cust_zip', '23', <type 'str'>)
    ('crap_crap_id', '/', <type 'str'>)
    ('crap_page_action', 'CRAPPY', <type 'str'>)
    ('crap_crapoto_config', 'SINGLE', <type 'str'>)
    ('crap_return_mode', 'GET', <type 'str'>)
    ('crap_site_id', u'16793461', <type 'unicode'>)
    ('crap_crapoto_date', '20170427092129', <type 'str'>)
    ('crap_crapoto_id', '336890', <type 'str'>)
    ('crap_url', u'http://example.com/crapoto/retour', <type 'unicode'>)
    

    "La liberté est à l'homme ce que les ailes sont à l'oiseau" Jean-Pierre Rosnay