Community
VRED Forum
Welcome to Autodesk’s VRED Forums. Share your knowledge, ask questions, and explore popular VRED topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

bad marshal data (unknown type code)

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
ir
Advocate
2566 Views, 2 Replies

bad marshal data (unknown type code)

Data saved from a ScriptPlugin in VRED 2020 with marshal.dump() cannot be loaded with marshal.load() in VRED 2021. 

 

ValueError: bad marshal data (unknown type code)

 

Does anybody have a remedy for this? 

 

Thanks!

Ingolf 

2 REPLIES 2
Message 2 of 3
sinje_thiedemann
in reply to: ir

Hi Ingolf,

I am not familiar with the marshal module, but I assume that it comes from the switch to Python 3.7.4 in VRED 2021 (from previous 2.7.10 in VRED 2020.3). You said that the data was saved in VRED 2020, so with Python 2.

 

From reading the documentation of marshal (here the version for Python 2: https://docs.python.org/2/library/marshal.html ), it sounds like this could very well be the reason. Blue highlighting by me:



>> This is not a general “persistence” module. For general persistence and transfer of Python objects through RPC calls, see the modules pickle and shelve. The marshal module exists mainly to support reading and writing the “pseudo-compiled” code for Python modules of .pyc files. Therefore, the Python maintainers reserve the right to modify the marshal format in backward incompatible ways should the need arise. If you’re serializing and de-serializing Python objects, use the pickle module instead – the performance is comparable, version independence is guaranteed, and pickle supports a substantially wider range of objects than marshal. <<

 

Sorry, I do not have a solution for this, maybe someone else does.

 

Kind regards

Sinje

Message 3 of 3
ir
Advocate
in reply to: sinje_thiedemann

Thanks Sinje, for looking into this! We'll follow your advice. Ingolf

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report