• Pavel Emelyanov's avatar
    crit: Fix casts for fixed and sfixed types · decf4f52
    Pavel Emelyanov authored
    The native pb engine doesn't accept types other than int or long:
    
    ...
      File "/root/src/criu/pycriu/images/pb2dict.py", line 264, in dict2pb
        pb_val.append(_dict2pb_cast(field, v))
      File "/usr/lib/python2.7/site-packages/google/protobuf/internal/containers.py", line 111, in append
        self._type_checker.CheckValue(value)
      File "/usr/lib/python2.7/site-packages/google/protobuf/internal/type_checkers.py", line 104, in CheckValue
        raise TypeError(message)
    TypeError: 1.1258999068426252e+16 has type <type 'float'>, but expected one of: (<type 'int'>, <type 'long'>)
    
    In particular, this is seen when encoding back so_filter field from
    inetsk image.
    Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
    Acked-by: 's avatarRuslan Kuprieiev <kupruser@gmail.com>
    decf4f52
pb2dict.py 7.63 KB