Python Forum

Full Version: Bad marshal data (string ref out of range) error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, I have an simple python script in a raspberry that the only thing that it do is execute some telegrams commands... http requests.... and enable or disable gpio outputs..

I run it on boot in crontab

15 days working fine and yesterday stops working, if I try to run manually and saw "bad marshal data (string reg out of range)".....

Who could be the trouble??
I tried several commands.... such as
apt --fix-broken install
pyclean .

And some more... and it start working again... someone knows about this error? How I can prevent that it fails again?

Python version installed is 2.7 and system up-to-date

Thanks!!
We would need to see some code and the full text of the error to really diagnose this problem. I expect you just got some bad data back from one of your requests. You can't stop bad data coming in, but you can handle it gracefully. Typically you would use a try/except block, and the failing gracefully part would go in the except clause. Where exactly you would put that would depend on the full text of the error.
Hi, but the trouble is not only with .py script...

I tried to use pip and get same error, try to execute only "python" and same error...

Can I search in the log system the error to post you? where can be logged this error?

Thanks a lot!!