Ask Your Question

unicode decode error when downloading zip-file

asked 2015-05-18 04:33:24 -0500

simo gravatar image

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,] 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/", line 196, in _worker result =, 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/", 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/", 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/", 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/", 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/", 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/", 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/", 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/", 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/", 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/", 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/", 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/", 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/", 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/", line 214, in download_worksheets ... (more)

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2015-05-18 08:51:00 -0500

kcrisman gravatar image

This could be a problem in your path, conceivably - see this answer.

Otherwise it's likely that there are some unusual characters elsewhere (in your title?) causing the problem... the last command there both reads and writes a file. Giving us more information about the exact setup, path, titles etc. would help diagnose this.

edit flag offensive delete link more


Python 2.7.6 (default, Mar 22 2014, 22:59:38) [GCC 4.8.2] on linux2 is installed in the following folders: /etc/python2.7/ /etc/python/debian_conf /usr/include/ and /usr/include/boost /usr/share and /usr/local /usr/lib and /usr/lib/debug/usr/lib /var/lib/python (/python3.2 ... 3.4_installed) ipython is in folders /usr/share and /home(/.ipython)

simo gravatar imagesimo ( 2015-05-18 14:15:49 -0500 )edit

Sage installation directory: /home/simo/Sage/sage-6.4.1-i686-Linux$ (ls -a) . build .gitignore Makefile src .. config COPYING.txt local README.txt VERSION.txt bootstrap configure .git m4 sage Sage app(?) directory: /home/simo/.sage$ (ls -a) . db ipython-2.1.0 matplotlib-1.3.1 temp .. gp-expect.log ipython-2.3.0 .python-eggs cache ipython-0.12 matplotlib-1.2.1 sage_notebook.sagenb

simo gravatar imagesimo ( 2015-05-18 14:16:42 -0500 )edit

When starting notebook, the following messages are shown in terminal:

sage: notebook() The notebook files are stored in: sage_notebook.sagenb ┌────────────────────────────────────────────────┐ │ │ │ Open your web browser to http://localhost:8080 │ │ │ └────────────────────────────────────────────────┘ Executing twistd --pidfile="sage_notebook.sagenb/" -ny "sage_notebook.sagenb/twistedconf.tac" /home/simo/Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/Crypto/Util/ PowmInsecureWarning: Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability. _warn("Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to a

simo gravatar imagesimo ( 2015-05-18 14:18:48 -0500 )edit

avoid timing attack vulnerability. _warn("Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.", PowmInsecureWarning) 2015-05-18 21:44:07+0300 [-] Log opened. 2015-05-18 21:44:07+0300 [-] twistd 14.0.2 (/home/simo/Sage/sage-6.4.1-i686-Linux/local/bin/python 2.7.8) starting up. 2015-05-18 21:44:07+0300 [-] reactor class: twisted.internet.epollreactor.EPollReactor. 2015-05-18 21:44:08+0300 [-] QuietSite starting on 8080 2015-05-18 21:44:08+0300 [-] Starting factory <__builtin__.QuietSite instance at 0xacf8072c> [6764:6764:0518/] Invalid url pattern: chrome://print/* [6764:6764:0518/] OnGetTokenFailure: Invalid credentials. [6764:6764:0518/

simo gravatar imagesimo ( 2015-05-18 14:20:14 -0500 )edit

6)] OnGetTokenFailure: Invalid credentials.

[6764:6861:0518/] PostClientToServerMessage() failed during GetUpdates

Worksheets are opened in the browser normally without any problems.

My worksheet are done/saved in sage-format. They don't contain any special characters (language US-en). They contain plots. The worksheet names are for example "Impulses", "Astrea Polars", "Production node equations" etc.

simo gravatar imagesimo ( 2015-05-18 14:24:24 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-05-18 04:33:24 -0500

Seen: 267 times

Last updated: May 18 '15