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

Python 2.7 decoding problem #24

Open
sphh opened this issue Feb 11, 2017 · 0 comments
Open

Python 2.7 decoding problem #24

sphh opened this issue Feb 11, 2017 · 0 comments

Comments

@sphh
Copy link

sphh commented Feb 11, 2017

Hi Mike,

I had to change the line 624 in PyCmdMessenger.py to get it working:

             w = "Warning: Guessing input format for {}. This can give wildly incorrect values. Consider specifying a format and sending binary data.".format(value)
             warnings.warn(w,Warning)
 
-        tmp_value = value.decode()
+        tmp_value = value.decode('utf-8')
 
         try:
             float(tmp_value)

I don't know what caused it. I use PyCmdMessenger in Python 2.7 and all files have the following headers:

#!/usr/bin/env python2
# -*- coding: utf-8 -*-

from __future__ import unicode_literals

I have to admit, that the unicode stuff is not my strong point ;-), so I have no idea why it's needed in Python 2.x with from __future__ import unicode_literals, but not in Python 3.x!! I also don't have any idea what effect it might have on Python 3.x...

Stephan

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

1 participant