Does pickled objects work fine between different OS?

O

Oltmans

If I dump a Python dictionary into a file named "data.pkl" using
Pickle module on a Linux operating system, will the data contained in
"data.pkl" load fine in a Windows OS? I mean will I be able to load
the dictionary data contained in "data.pkl" just fine on Windows XP?

I could have tested it but don't have immediate access to a *nix based
system so please enlighten me. All help will be appreciated.
 
D

Daniel Fetchinson

If I dump a Python dictionary into a file named "data.pkl" using
Pickle module on a Linux operating system, will the data contained in
"data.pkl" load fine in a Windows OS?
Yes.

I mean will I be able to load the dictionary data contained in "data.pkl"
just fine on Windows XP?

Yes.

Cheers,
Daniel
 
R

Ross Ridge

Oltmans said:
If I dump a Python dictionary into a file named "data.pkl" using
Pickle module on a Linux operating system, will the data contained in
"data.pkl" load fine in a Windows OS? I mean will I be able to load
the dictionary data contained in "data.pkl" just fine on Windows XP?

That will work just fine. The only thing that may be a problem is that
if you choose to use the newer pickle format, it won't work with versions
of Python before 2.3.

Ross Ridge
 
G

Grant Edwards

If I dump a Python dictionary into a file named "data.pkl" using
Pickle module on a Linux operating system, will the data contained in
"data.pkl" load fine in a Windows OS?

That depends on the data and the version of Python. Older versions
didn't handle some floating point values (NAN, INF) in a portable
manner, and loading the pickled data would fail when such a value was
encountered.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top