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

Sympy live shell is giving UnicodeEncodeError #197

Open
guu1227 opened this issue Oct 30, 2021 · 2 comments
Open

Sympy live shell is giving UnicodeEncodeError #197

guu1227 opened this issue Oct 30, 2021 · 2 comments

Comments

@guu1227
Copy link

guu1227 commented Oct 30, 2021

This is occurring for me every time I try to run anything in sympy live, looks like a case of needing to use .encode for encoding unicode:
>>> str(Integral(sqrt(1/x), x)) Exception in SymPy Live of type <type 'exceptions.UnicodeEncodeError'> for reference the last 5 stack trace entries are Traceback (most recent call last): File "/base/data/home/apps/s~sympy-live-hrd/66.426491309333028408/app/handlers.py", line 271, in post live.evaluate(statement, session, printer, stream) File "/base/data/home/apps/s~sympy-live-hrd/66.426491309333028408/app/shell.py", line 280, in evaluate exec code in statement_module.__dict__ File "<string>", line 1, in <module> File "/base/data/home/apps/s~sympy-live-hrd/66.426491309333028408/sympy/sympy/printing/pretty/pretty.py", line 2665, in pretty_print imaginary_unit=imaginary_unit)) File "/base/alloc/tmpfs/dynamic_runtimes/python27g/3f4b27f16594164f/python27/python27_lib/versions/1/google/appengine/runtime/request_environment.py", line 104, in write self._request.errors.write(data) UnicodeEncodeError: 'ascii' codec can't encode character u'\u2320' in position 0: ordinal not in range(128)

@ivanistheone
Copy link
Contributor

Traceback reformatted for readability:

>>> str(Integral(sqrt(1/x), x))
Exception in SymPy Live of type <type 'exceptions.UnicodeEncodeError'>
File "app/handlers.py", line 271, in post live.evaluate(statement, session, printer, stream)
File "app/shell.py", line 280, in evaluate exec code in statement_module.__dict__ File "<string>", line 1, in <module>
File "pretty.py", line 2665, in pretty_print imaginary_unit=imaginary_unit))
File "google/appengine/runtime/request_environment.py", line 104, in write self._request.errors.write(data) UnicodeEncodeError: 'ascii' codec can't encode character u'\u2320' ('TOP HALF INTEGRAL') in position 0: ordinal not in range(128)

I'm not able to reproduce. I tried with both LaTeX and Unicode Output Formats:

Screen Shot 2021-10-30 at 8 11 10 AM

Possibly something earlier the session broke, but Integral(sqrt(1/x), x) in isolation seems to work:

@guu1227 could you please try opening this link in an incognito/private browser to test:
https://live.sympy.org/?evaluate=Integral(sqrt(1%2Fx)%2C%20x)%0A%23--%0Astr(Integral(sqrt(1%2Fx)%2C%20x))%0A%23--%0A

@guu1227
Copy link
Author

guu1227 commented Nov 10, 2021

Sorry I missed this comment
I'm not getting the trace with either a private browser or a normal browser on the linked page. It only seems to be occurring when I try to use the pop up live shell on the sympy tutorial web page.
Also, it doesn't happen when I open the tutorial page in a private browser. The trace does appear if I try to run any command on the tutorial page's sympy live shell using a normal browser, though.

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

No branches or pull requests

2 participants