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

Unicode not working in Python 3.2 #186

Closed
jarvisteach opened this Issue Jun 22, 2017 · 3 comments

Comments

Projects
None yet
1 participant
@jarvisteach
Owner

jarvisteach commented Jun 22, 2017

Python 3.2 raises a syntax error for the code: entry.lab.config(text=u'\u2714', fg="#4CC417")

In Python 3.0, 3.1, 3.2 the u prefix was removed.
It existed in Python 2.7, and was reintroduced in 3.3.

@jarvisteach jarvisteach added the bug label Jun 22, 2017

@jarvisteach jarvisteach self-assigned this Jun 22, 2017

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Jun 22, 2017

Owner

After some more research, it turns out the u prefix in Python 3.x is actually meaningless.
All Strings in Python 3.x are Unicode - the purpose of the prefix was to tell Python 2.x that the String was Unicode.

As it was unnecessary in Python 3.x it was removed, but later reintroduced to keep code backward compatible.

To support all versions of Python, it is better to not use the u prefix, and instead use __future__ in Python 2.x to get access to Unicode Strings: from __future__ import unicode_literals

Owner

jarvisteach commented Jun 22, 2017

After some more research, it turns out the u prefix in Python 3.x is actually meaningless.
All Strings in Python 3.x are Unicode - the purpose of the prefix was to tell Python 2.x that the String was Unicode.

As it was unnecessary in Python 3.x it was removed, but later reintroduced to keep code backward compatible.

To support all versions of Python, it is better to not use the u prefix, and instead use __future__ in Python 2.x to get access to Unicode Strings: from __future__ import unicode_literals

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Jun 22, 2017

Owner

This will require a new import, a change to the ValidationEntry and an update to the docs regarding Unicode.

Owner

jarvisteach commented Jun 22, 2017

This will require a new import, a change to the ValidationEntry and an update to the docs regarding Unicode.

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Jun 22, 2017

Owner

Even though we have resolved it in appJar, that doesn't resolve it externally. There is no universal way to support unicode, without importing from __future__

So, will advise to only use the u prefix with python 2.x

Owner

jarvisteach commented Jun 22, 2017

Even though we have resolved it in appJar, that doesn't resolve it externally. There is no universal way to support unicode, without importing from __future__

So, will advise to only use the u prefix with python 2.x

jarvisteach added a commit that referenced this issue Jun 23, 2017

Fixed issue with Unicode (#186)
Removed use of `u` prefix, and added import of `unicode_literals` from
`__future__`

Also, rolled back addition of Python 3.2 from `.travis.yml`

jarvisteach added a commit that referenced this issue Jun 23, 2017

@jarvisteach jarvisteach added this to the 0.07 milestone Jul 10, 2017

jarvisteach added a commit that referenced this issue Jul 22, 2017

jarvisteach added a commit that referenced this issue Jul 23, 2017

jarvisteach added a commit that referenced this issue Jul 23, 2017

jarvisteach added a commit that referenced this issue Jul 23, 2017

jarvisteach added a commit that referenced this issue Jul 23, 2017

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