Projet

Général

Profil

0001-storage-handle-tuple-likes-in-deep_bytes2str.patch

Benjamin Dauvergne, 23 janvier 2020 10:55

Télécharger (1008 octets)

Voir les différences:

Subject: [PATCH 1/7] storage: handle tuple likes in deep_bytes2str

It fixes a throws with wcs.wf.create_formdata.Mapping which is a
collections.mamedtuple().
 wcs/qommon/storage.py | 2 ++
 1 file changed, 2 insertions(+)
wcs/qommon/storage.py
130 130
        for k, v in obj.items():
131 131
            new_d[force_str(k)] = deep_bytes2str(v, seen)
132 132
        return new_d
133
    if isinstance(obj, tuple):
134
        return obj.__class__(*[deep_bytes2str(x, seen) for x in obj])
133 135
    if hasattr(obj, '__class__') and obj.__class__.__module__.startswith(('wcs.', 'qommon.', 'modules.')):
134 136
        obj.__dict__ = deep_bytes2str(obj.__dict__, seen)
135 137
        return obj
136
-