-
Notifications
You must be signed in to change notification settings - Fork 5
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
Exception on str decode & making it work in terminal #2
Comments
I am having the same problem.
I am a python enthusiast, so I am going to investigate a little bit and see if the forks have addressed this issue. |
jeffsilverm
pushed a commit
to jeffsilverm/code_examples
that referenced
this issue
Dec 26, 2019
kodie/ansiescapes#2 jeffs@jeffs-desktop:/home/jeffs/python/ansiescapes/ansiescapes-master (development) * $ diff ansiescapes.py original_ansiescapes.py 8,17c8 < def _(s): < # A solution to issue 2, kodie/ansiescapes#2 < # Because I don't know what the data type of s is going to be (it might < # be a type that has a decode function such as byte array ), simple test < # is s has a decode method. If it does, great, call it, otherwise, just < # return s. < if hasattr(s, "decode"): < return s.decode('unicode_escape') < else: < return s --- > def _(s): return s.decode('unicode_escape'); jeffs@jeffs-desktop:/home/jeffs/python/ansiescapes/ansiescapes-master (development) * $
jeffsilverm
added a commit
to jeffsilverm/ansiescapes
that referenced
this issue
Dec 26, 2019
Solve issue kodie#2 jeffs@jeffs-desktop:/home/jeffs/python/ansiescapes/ansiescapes-master (development) * $ diff ansiescapes.py original_ansiescapes.py 8,17c8 < def _(s): < # A solution to issue 2, kodie#2 < # Because I don't know what the data type of s is going to be (it might < # be a type that has a decode function such as byte array ), simple test < # is s has a decode method. If it does, great, call it, otherwise, just < # return s. < if hasattr(s, "decode"): < return s.decode('unicode_escape') < else: < return s --- > def _(s): return s.decode('unicode_escape');
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ansiescapes/ansiescapes.py
Line 8 in 25a4b90
I'm in no way python enthusiast but this line results in error:
So shouldn't it be
decode
?Also to actually use to manipulate terminal with
sys.stdout.buffer.write
imho ESC should be:\033[
although there is character[
added, while it's not a part of escape key :) as well as it shouldn't be ansii_escaped so that it would actually work.The text was updated successfully, but these errors were encountered: