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

pprint: problems with unicode symbols #3868

Closed
navytux opened this issue Mar 31, 2008 · 9 comments
Closed

pprint: problems with unicode symbols #3868

navytux opened this issue Mar 31, 2008 · 9 comments
Labels
Bug Dropping Python 2 Related to dropping Python 2 support in 2020 imported printing

Comments

@navytux
Copy link

navytux commented Mar 31, 2008

In [1]: a = Symbol('ПРИВЕТ')

In [2]: a
Out[2]: ПРИВЕТ

In [3]: sin(a)
Out[3]: sin(ПРИВЕТ)

In [4]: a/2
## Out[4]:

UnicodeDecodeError                        Traceback (most recent call last)

...

/home/kirr/src/sympy/sympy-official/sympy/printing/pretty/stringpict.py in
stack(*args)
    135         newPicture = [line.center(newWidth) for line in newPicture]
    136         newBaseline = objects[0].height()+objects[1].baseline
--> 137         return '\n'.join(newPicture), newBaseline
    138 
    139     def below(self, *args):

UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0:
ordinal not in ra
nge(128)

Original issue for #3868: http://code.google.com/p/sympy/issues/detail?id=769

Original author: https://code.google.com/u/111152560333599832822/

@rlamy
Copy link
Member

rlamy commented May 3, 2011

**Labels:** Printing  

Original comment: http://code.google.com/p/sympy/issues/detail?id=769#c1
Original author: https://code.google.com/u/101272611947379421629/

@vperic
Copy link
Contributor

vperic commented Oct 23, 2011

This still applies. While I doubt anyone would name their constants "privet", it might be useful to have this option. I'll just mark this as Accepted (rather than New), but I don't think I'll be able to fix it.

**Status:** Accepted  

Original comment: http://code.google.com/p/sympy/issues/detail?id=769#c2
Original author: https://code.google.com/u/108713607268198052411/

@asmeurer
Copy link
Member

**Status:** Valid  

Original comment: http://code.google.com/p/sympy/issues/detail?id=769#c3
Original author: https://code.google.com/u/asmeurer@gmail.com/

@sympy-issue-migrator
Copy link

This seems to be a python2 issue. This bug is totally still present if you're running python2, and I'm looking to see if I can figure out how to fix it for python2, but in python3:

>>> from sympy import *
>>> a = symbols("ПРИВЕТ")
>>> pretty_print(a)
ПРИВЕТ
>>> pretty_print(sin(a))
sin(ПРИВЕТ)
>>> pretty_print(a/2)
ПРИВЕТ
──────
  2

Original comment: http://code.google.com/p/sympy/issues/detail?id=769#c4
Original author: https://code.google.com/u/106119206808377465743/

@asmeurer
Copy link
Member

asmeurer commented Aug 6, 2013

Is it just a matter of putting u before the " ?

Original comment: http://code.google.com/p/sympy/issues/detail?id=769#c5
Original author: https://code.google.com/u/asmeurer@gmail.com/

@sympy-issue-migrator
Copy link

It breaks in new and different ways (in python2) if you add the "u", including not correctly printing if you just type "a" into the prompt.

Original comment: http://code.google.com/p/sympy/issues/detail?id=769#c6
Original author: https://code.google.com/u/106119206808377465743/

@asmeurer
Copy link
Member

asmeurer commented Aug 7, 2013

I noticed that IPython seems to have some issues of its own.

Original comment: http://code.google.com/p/sympy/issues/detail?id=769#c7
Original author: https://code.google.com/u/asmeurer@gmail.com/

@asmeurer
Copy link
Member

asmeurer commented Aug 7, 2013

Nevermind, that was an issue with my IPython profile (it turns out that if you use \M-P in your readline parse_and_bind, it conflicts with П; the solution is to use \eP instead).

Original comment: http://code.google.com/p/sympy/issues/detail?id=769#c8
Original author: https://code.google.com/u/asmeurer@gmail.com/

@oscarbenjamin oscarbenjamin added the Dropping Python 2 Related to dropping Python 2 support in 2020 label Apr 29, 2019
@eric-wieser
Copy link
Member

This can be closed now that python 2 is dropped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Dropping Python 2 Related to dropping Python 2 support in 2020 imported printing
Projects
None yet
Development

No branches or pull requests

8 participants