redux type erro
Added by Harry Kao over 10 years ago
Hi, This error is from a new installation of Legion. I try to display images in the myamiweb,and receive the following error messages:
Running Read(24352848,filename=/catalina.raid.F30/Image/14mar24b/rawdata/14mar24b_EMCV10a_00011gr_00322sq_v02_00009hl.mrc,info=False)
Running Shape(24352784,shape=(512, 494))
1396378956.76
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/redux/server.py", line 39, in run_process
result = pipeline.process(**kwargs)
File "/usr/local/lib/python2.7/site-packages/redux/pipeline.py", line 147, in process
results.put(done, result)
File "/usr/local/lib/python2.7/site-packages/redux/cache.py", line 40, in put
return self._put(pipeline, result)
File "/usr/local/lib/python2.7/site-packages/redux/cache.py", line 35, in _put
self.file_put(pipeline, result)
File "/usr/local/lib/python2.7/site-packages/redux/cache.py", line 82, in file_put
final_pipe.put_result(f, result)
File "/usr/local/lib/python2.7/site-packages/redux/pipe.py", line 90, in put_result
cPickle.dump(result, f, cPickle.HIGHEST_PROTOCOL)
TypeError: must be unicode, not str
Replies (2)
RE: redux type erro - Added by Harry Kao over 10 years ago
Hi, By changing line 82 in ..../site-packages/redux/cache.py to
-------
f = self.diskcache.open(resultfilename, 'wb')
The images can be displayed, but I am not sure if this is the proper fix.
Harry
RE: redux type erro - Added by Sargis Dallakyan over 10 years ago
Thank you for the message. We are using redux on CentoOS 6 that comes with python 2.6 and we haven't had this issue. I don't know if we'll have the same issue when we transition from python 2.6 to 2.7, but your fix sounds good - http://stackoverflow.com/questions/4512982/python-typeerror-cant-write-str-to-text-stream
There is also Working around Python bug in different versions that suggest try/except with unicode conversion. I would prefer this option if we had to support both version of python 2.6 and 2.7.