ernstAlert
(ernstAlert)
July 30, 2014, 12:41am
296
Hi ,
I was having an issue regarding the error that some were posting about that said ART was giving the error “can’t convert string to float”. Well I did some digging and playing around and it seems it’s an issue with pickle on load. It is (as some have mentioned) an issue with line endings and it seems that git (at least for me) is what is causing this issue.
The short term fix for this for me was to tell git not to autocrlf so it would keep the line endings the same. I tried a few things like changing all the data files to binary on read and write and I also tried to open files with rU instead of just r which should tell it universal line endings. None of that seemed to work.
I think a long term fix would be to maybe add a try around pickle.load and if it fails try to convert the line endings (there are some py libs that do this like dos2unix). Or maybe on maya start just run through the files real quick (maybe on a bg thread) and make sure they are converted.
I took the easy way out on this one because I didn’t want to have to manage having a separate version of your code while you’re still actively updating it.
Anyway, those were my observations with this issue and some thoughts on it. Great work on this so far btw. It’s definitely a useful tool and I only see it becoming more useful as time goes on. Thanks for all the hard work on this.
ah, thanks for the useful info! I think I’ll need to switch away from the cPickle module and use something else, since git/perforce screw with line endings. I’ll pick something more friendly to write to.