Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sagenb notebook -- error when downloading worksheets in some cases involving non-ASCII characters #9711

Closed
williamstein opened this issue Aug 9, 2010 · 10 comments

Comments

@williamstein
Copy link
Contributor

I hope this traceback from the serverlog on prep.sagenb.org will help me to debug and fix this:


2010-08-09 14:11:02-0700 [-] Exception rendering:
2010-08-09 14:11:02-0700 [-] Unhandled Error
        Traceback (most recent call last):          File "/usr/local/sage-prep/local/lib/python/threading.py", line 497, in __bootstrap
            self.__bootstrap_inner()
          File "/usr/local/sage-prep/local/lib/python/threading.py", line 525, in __bootstrap_inner            self.run()
          File "/usr/local/sage-prep/local/lib/python/threading.py", line 477, in run
            self.__target(*self.__args, **self.__kwargs)
        --- <exception caught here> ---
          File "/usr/local/sage-prep/local/lib/python2.6/site-packages/twisted/python/threadpool.py", line 210, in _worker
            result = context.call(ctx, function, *args, **kwargs)
          File "/usr/local/sage-prep/local/lib/python2.6/site-packages/twisted/python/context.py", line 59, in callWithContext
            return self.currentContext().callWithContext(ctx, func, *args, **kw)
          File "/usr/local/sage-prep/local/lib/python2.6/site-packages/twisted/python/context.py", line 37, in callWithContext
            return func(*args,**kw)
          File "/usr/local/sage-prep/sagenb-0.8.p2/src/sagenb/sagenb/notebook/twist.py", line 1448, in f
            notebook.export_worksheet(worksheet.filename(), sws_filename)
          File "/usr/local/sage-prep/sagenb-0.8.p2/src/sagenb/sagenb/notebook/notebook.py", line 983, in export_work
sheet
            S.export_worksheet(username, id_number, output_filename, title=title)
          File "/usr/local/sage-prep/sagenb-0.8.p2/src/sagenb/sagenb/storage/filesystem_storage.py", line 362, in ex
port_worksheet
            open(worksheet_txt,'w').write(old_heading + open(worksheet_html).read())
        exceptions.UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 180: ordinal not in range(12
8)

CC: @ppurka @jasongrout @kini

Component: notebook

Author: Tim Dumol

Issue created by migration from https://trac.sagemath.org/ticket/9711

@TimDumol
Copy link
Mannequin

TimDumol mannequin commented Aug 19, 2010

Attachment: trac_9711-unicode-worksheets.patch.gz

Wraps the arguments of the write call in an encoded_str() call.

@TimDumol
Copy link
Mannequin

TimDumol mannequin commented Aug 19, 2010

comment:1

I have been unable to replicate the issue, even with rather exotic unicode characters (in the title and the body), but this should fix any possible problems (hopefully).

@TimDumol TimDumol mannequin added the s: needs review label Aug 19, 2010
@jdemeyer
Copy link

comment:2

Please fill in your real name as Author.

@TimDumol
Copy link
Mannequin

TimDumol mannequin commented Jul 28, 2012

Author: Tim Dumol

@TimDumol
Copy link
Mannequin

TimDumol mannequin commented Jul 28, 2012

comment:3

I think this should be closed. Codec related issues should be long gone, especially with the internationalization changes that have occurred since this.

@kcrisman
Copy link
Member

comment:4

If this is still valid, the relevant code has changed slightly, so this wouldn't apply. Also, we should probably create a pull request.

Or, as Tim suggests, if not, we could indeed close this. It's unfortunate William didn't attach a sample sws :( I'd go with Tim, though I think that we should have at least one current sagenb guru also confirm his statement.

@kcrisman kcrisman removed this from the sage-5.10 milestone Jun 11, 2013
@jasongrout
Copy link
Member

comment:5

I know I fixed a lot of issues involving errors like this last year.

@slel
Copy link
Member

slel commented Aug 30, 2016

@fchapoton
Copy link
Contributor

Attachment: testdoc3.sws.gz

@embray
Copy link
Contributor

embray commented Aug 14, 2018

comment:7

Appears to be fixed in SageNB; see the upstream issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants