Letractively / sagenb

Automatically exported from code.google.com/p/sagenb
0 stars 0 forks source link

unicode data file names cause errors #82

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I saw this error in the sagenb.org logs.  It seems to indicate that some data 
files had unicode names.  We should sanitize the data file names like we 
sanitize the user names, or we should assume that filenames are possibly 
unicode and change our template

2011-12-14 06:52:17-0800 [-] WSGI application error
        Traceback (most recent call last):
          File "/sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/Twisted-11.0.0-py2.6-linux-x86_64.egg/twisted/python/threadpool.py", line 230, in _worker
            o = self.q.get()
          File "/sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/Twisted-11.0.0-py2.6-linux-x86_64.egg/twisted/python/context.py", line 118, in callWithContext
            return self.currentContext().callWithContext(ctx, func, *args, **kw)
          File "/sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/Twisted-11.0.0-py2.6-linux-x86_64.egg/twisted/python/context.py", line 83, in callWithContext
            self.contexts.pop()
          File "/sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/Twisted-11.0.0-py2.6-linux-x86_64.egg/twisted/web/wsgi.py", line 338, in run
            self.started = True
        --- <exception caught here> ---
          File "/sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/Twisted-11.0.0-py2.6-linux-x86_64.egg/twisted/web/wsgi.py", line 313, in run
            appIterator = self.application(self.environ, self.startResponse)
          File "/sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/flask/app.py", line 1518, in __call__
            return self.wsgi_app(environ, start_response)
          File "/sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/flask/app.py", line 1506, in wsgi_app
            response = self.make_response(self.handle_exception(e))
          File "/sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/flask/app.py", line 1504, in wsgi_app
            response = self.full_dispatch_request()
          File "/sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/flask/app.py", line 1264, in full_dispatch_request
            rv = self.handle_user_exception(e)
          File "/sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/flask/app.py", line 1262, in full_dispatch_request
            rv = self.dispatch_request()
          File "/sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/flask/app.py", line 1248, in dispatch_request
            return self.view_functions[rule.endpoint](**req.view_args)
          File "/sagenb/sage_install/sage-4.7.2/devel/sagenb/flask_version/decorators.py", line 27, in wrapper
            return f(*args, **kwds)
          File "/sagenb/sage_install/sage-4.7.2/devel/sagenb/flask_version/worksheet.py", line 45, in wrapper
            return f(username, id, **kwds)
          File "/sagenb/sage_install/sage-4.7.2/devel/sagenb/flask_version/worksheet.py", line 89, in worksheet
            username=g.username)
          File "/sagenb/sage_install/sage-4.7.2/devel/sagenb-flask/sagenb/notebook/notebook.py", line 1678, in html
            username = username)
          File "/sagenb/sage_install/sage-4.7.2/devel/sagenb-flask/sagenb/notebook/template.py", line 154, in template
            r = tmpl.render(**context)
          File "/sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/jinja2/environment.py", line 894, in render
            return self.environment.handle_exception(exc_info, True)
          File "/sagenb/sage_install/sage-4.7.2/devel/sagenb-flask/sagenb/data/sage/html/notebook/worksheet_page.html", line 1, in top-level template code
            {% extends "html/notebook/base.html" %}
          File "/sagenb/sage_install/sage-4.7.2/devel/sagenb-flask/sagenb/data/sage/html/notebook/base.html", line 11, in top-level template code
            {% set system_names = worksheet.notebook().system_names() %}
          File "/sagenb/sage_install/sage-4.7.2/devel/sagenb-flask/sagenb/data/sage/html/base_authenticated.html", line 1, in top-level template code
            {% extends "html/base.html" %}
          File "/sagenb/sage_install/sage-4.7.2/devel/sagenb-flask/sagenb/data/sage/html/base.html", line 43, in top-level template code
            {% block body %}
          File "/sagenb/sage_install/sage-4.7.2/devel/sagenb-flask/sagenb/data/sage/html/base.html", line 62, in block "body"
            {% block main %}
          File "/sagenb/sage_install/sage-4.7.2/devel/sagenb-flask/sagenb/data/sage/html/notebook/base.html", line 119, in block "main"
            <option value="datafile?name={{ name }}">{{ name }}</option>
        exceptions.UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)

Original issue reported on code.google.com by jason-go...@creativetrax.com on 14 Dec 2011 at 6:52

GoogleCodeExporter commented 8 years ago
See https://github.com/sagemath/sagenb/issues/279

Original comment by kcris...@gmail.com on 3 Dec 2014 at 9:43