protobuf-to-dict icon indicating copy to clipboard operation
protobuf-to-dict copied to clipboard

name 'long' is not defined

Open sunclb opened this issue 4 years ago • 4 comments

python 3.8 install from pip, run import encounter name 'long' is not defined error

from protobuf_to_dict import protobuf_to_dict NameError Traceback (most recent call last) in ----> 1 from protobuf_to_dict import protobuf_to_dict

~/miniconda3/envs/UDL-rtwr/lib/python3.8/site-packages/protobuf_to_dict.py in 13 FieldDescriptor.TYPE_FLOAT: float, 14 FieldDescriptor.TYPE_INT32: int, ---> 15 FieldDescriptor.TYPE_INT64: long, 16 FieldDescriptor.TYPE_UINT32: int, 17 FieldDescriptor.TYPE_UINT64: long,

NameError: name 'long' is not defined

sunclb avatar Dec 16 '20 03:12 sunclb

yep, see same thing... please fix

brucebookman avatar Feb 19 '21 23:02 brucebookman

BTW - if i comment all the long in the map, i get name 'unicode' is not defined

brucebookman avatar Feb 19 '21 23:02 brucebookman

if sys.version_info > (3, 0): long, unicode, basestring = int, str, str

StupidArthur avatar Feb 24 '21 03:02 StupidArthur

A working solution to this problem is mentioned in another issue: https://github.com/benhodgson/protobuf-to-dict/issues/15#issuecomment-368152202

szulcmaciej avatar May 26 '21 08:05 szulcmaciej