SystemError in Learning Python Example

Fredrik Lundh fredrik at pythonware.com
Tue Dec 21 05:54:17 EST 1999


kopecjc <kopecjc at worldnet.att.net> wrote:
> I am pretty sure that all the required files on the right
> paths.  Does anyone know what could be causing the "SystemError"
> message?  I would have thought that FeedbackData is from module
> feedback, not __main__.  Does anyone have any idea why the pickle module
> would have expected it to be from __main__?

probably because you created the pickle by running
the program as:

    $ python feedback.py

this executes the code in feedback.py in a module
called "__main__".  if you read the pickle from another
script, it's quite likely are that you don't have the same
class in that script...

to make pickle work properly with classes, put the class
definitions in a separate module, and import it into your
main script.

</F>





More information about the Python-list mailing list