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

get a Warning from python-click 5.1 #13

Closed
ghost opened this issue Oct 18, 2015 · 2 comments

Comments

@ghost
Copy link

@ghost ghost commented Oct 18, 2015

/usr/lib/python2.7/site-packages/doitlive-2.3.1-py2.7.egg/doitlive.py:598: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/

this fixed it:

diff --git a/doitlive.py b/doitlive.py
index 377f102..3aa6408 100755
--- a/doitlive.py
+++ b/doitlive.py
@@ -10,7 +10,7 @@
   :license: MIT, see LICENSE for more details.
 """

-from __future__ import unicode_literals
+#from __future__ import unicode_literals
 import datetime as dt
 import functools
 import os
@@ -252,11 +252,11 @@ def get_current_vcs_branch():


 # Some common symbols used in prompts
-R_ANGLE = TermString('❯')
-R_ANGLE_DOUBLE = TermString('»')
-R_ARROW = TermString('➔')
-DOLLAR = TermString('$')
-PERCENT = TermString('%')
+R_ANGLE = TermString(u'❯')
+R_ANGLE_DOUBLE = TermString(u'»')
+R_ARROW = TermString(u'➔')
+DOLLAR = TermString(u'$')
+PERCENT = TermString(u'%')

@Stefan-Code

This comment has been minimized.

Copy link
Contributor

@Stefan-Code Stefan-Code commented Oct 18, 2015

I just tried your fix, but unfortunately it's a bit more complicated than that. Playing back a sessions works but some unit-tests regarding themes fail. I fixed it like this for now, although it's not a very elegant solution.

@Stefan-Code

This comment has been minimized.

Copy link
Contributor

@Stefan-Code Stefan-Code commented Oct 18, 2015

Fixed this in my latest pull request

sloria added a commit that referenced this issue Oct 18, 2015
Unicode literals and other stuff. Fixes #12 and #13 (nicely this time)
@sloria sloria closed this Oct 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.