In the following Python code, where the protobuf generated files are in a
different directory, pickle fails for 2.6.1 generated code where it did not
fail for 2.5.0.

It works if the generated file and the importing file are in the same directory
but that is not the case that I have.

Is there a workaround for this?


import Interface.base_pb2 as base
import cPickle as pickle

# instantiaton works
m = base.Base()
m.id = 1

# pickle works with 2.5.0 but not with 2.6.1
# cPickle.PicklingError: Can't pickle <class 'base_pb2.Base'>: import of module
base_pb2 failed

# base.proto

message Base {
optional int32 id = 1;
repeated int32 ids = 2;
extensions 1000 to 1999;

You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to