Blender 2.5 pickle problem

Okay…
so I am doing some more networking with blender but this time, I am using blender 2.5

the problem is when I am wanting to send the data and the data is in pickle.dumps, it gives me an error for the client and the server shutsdown.

The server is a python window using python 2.6
the client is in blender 2.5

hope you can help or tell me why. I thought it was because the python that comes with blender hasn’t been put properly or something

I personally don’t know, but why not see what pickle is dumping (or un-pickle it and print that; if it shows not the same info you put out, then the server would give an error.)

dumping the data is all fine but it is when I try to load it from the server or client that the error occurs.
I tried to run my server from a blender 2.5 window and it worked perfectly but it is when I run the server as a console window and the client in 2.5

BTW in blender 2.49b it worked perfectly using this model

Is the pickle data and format compatible between python 2.6 and 3.1? I’m just guessing though…

What is the error you get. Your desciption is unclear.
Does the server get an error eas well?

Have you tried without pickle? Just sending an echotest (one byte). To make sure it is not a problem on how you send the data.

yes I have tried sending it just a raw data and it works. I am sure its nothing to do with the sockets.

the server also gets the error. I am not on my PC right now so I can’t tell you the error.

what version does blender 2.5 use for python?

it is Python 3.x
maybe 2.6 and 3.x Python pickles are not compatible. Maybe switching to a zip algorithm, that should be independent of the Python versions.

I think you may be right.

I will try and get back to you with the result mate.

Monster is right, python 2.x pickle dumps are not compatible with python 3.x (although there might be an option to use the older encoding when loading them)

In addition, with python 3 you will most likely have to use binary format file I/O when dumping with pickle

fo = open(“foo.txt”, “wb”)

use ‘wb’ and ‘rb’ instead of ‘w’ and ‘r’

yeah thankyou very much mate. you are right.