"Tracing faults and deploying on OSX" non-line names in Numpy dtype unpickling "

I'm trying to sort and print an instance of the data class I'm working with, and everything works on Unix:

import dataclass as dc data = dc.DataClass() f = open(filename, 'wb') pickle.dump(data, f) f.close() f = open(filename, 'rb') unpickled_data = pickle.load(f) 

So, I can work with unpicked_data . However, when I try to follow these same steps on Mac OS X, I get the error message:

 f = open(filename, 'rb') unpickled_data = pickle.load(f) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) pickle.pyc in load(file) 1376 1377 def load(file): -> 1378 return Unpickler(file).load() 1379 1380 def loads(str): pickle.pyc in load(self) 856 while 1: 857 key = read(1) --> 858 dispatch[key](self) 859 except _Stop, stopinst: 860 return stopinst.value pickle.pyc in load_build(self) 1215 setstate = getattr(inst, "__setstate__", None) 1216 if setstate: -> 1217 setstate(state) 1218 return 1219 slotstate = None ValueError: non-string names in Numpy dtype unpickling 

I tried etching and mailing out simple objects like dictionaries on OS X, and it seems to work fine. But for some reason, this data class does not like it. Any help is much appreciated! Thanks.

+6
source share

Source: https://habr.com/ru/post/984446/


All Articles