Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

unicode decode error when downloading zip-file

Tried to Download worksheet files from my sage notebook in my Ubuntu 14.04 and got the following error messages. Any idea how to fix the problem?

Found the reason to the problem: it's an UniCodeError as follows.

2015-05-17 19:07:57+0300 [HTTPChannel,88,127.0.0.1] Starting zipping a group of worksheets in a separate thread... 2015-05-17 19:07:59+0300 [-] WSGI application error Traceback (most recent call last): File "/home/.../Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/Twisted-14.0.2-py2.7-linux-i686.egg/twisted/python/threadpool.py", line 196, in _worker result = context.call(ctx, function, args, kwargs) File "/home/.../Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/Twisted-14.0.2-py2.7-linux-i686.egg/twisted/python/context.py", line 118, in callWithContext return self.currentContext().callWithContext(ctx, func, *args, *kw) File "/home/.../Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/Twisted-14.0.2-py2.7-linux-i686.egg/twisted/python/context.py", line 81, in callWithContext return func(args,kw) File "/home/.../Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/Twisted-14.0.2-py2.7-linux-i686.egg/twisted/web/wsgi.py", line 332, in run self.reactor.callFromThread(wsgiError, self.started, *exc_info()) --- <exception caught="" here=""> --- File "/home/.../Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/Twisted-14.0.2-py2.7-linux-i686.egg/twisted/web/wsgi.py", line 315, in run appIterator = self.application(self.environ, self.startResponse) File "/home/.../Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1836, in __call__ return self.wsgi_app(environ, start_response) File "/home/.../Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1820, in wsgi_app response = self.make_response(self.handle_exception(e)) File "/home/.../Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1403, in handle_exception reraise(exc_type, exc_value, tb) File "/home/simo/Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1817, in wsgi_app response = self.full_dispatch_request() File "/home/.../Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1477, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/.../Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1381, in handle_user_exception reraise(exc_type, exc_value, tb) File "/home/.../Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1475, in full_dispatch_request rv = self.dispatch_request() File "/home/.../Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1461, in dispatch_request return self.view_functionsrule.endpoint File "/home/.../Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/sagenb-0.11.1-py2.7.egg/sagenb/flask_version/decorators.py", line 22, in wrapper return f(args, **kwds) File "/home/.../Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/sagenb-0.11.1-py2.7.egg/sagenb/flask_version/worksheet_listing.py", line 214, in download_worksheets g.notebook.export_worksheet(worksheet.filename(), sws_filename) File "/home/.../Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/sagenb-0.11.1-py2.7.egg/sagenb/notebook/notebook.py", line 741, in export_worksheet S.export_worksheet(username, id_number, output_filename, title=title) File "/home/.../Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/sagenb-0.11.1-py2.7.egg/sagenb/storage/filesystem_storage.py", line 468, in export_worksheet f.write(old_heading + g.read())

exceptions.UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 446: ordinal not in range(128)