Convert STDOUT from Popen's to UTF-8 #348
Reference in New Issue
Block a user
Delete Branch "Python_Stdout"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
By default, Python3's STDOUT's that come back from Popen commands
are byte-arrays, not strings. So attempting to do string operations
(like 'split' or 'strip') fail. They must be converted to UTF-8
strings first.
This was causing the enclosure plugin to return false debug messages about
'disabling SUDO' when attempting to read my DHT22 sensor.
Thanks @Yeraze , I was able to get my DHT22 running after upgrading to Python 3. One note is that the logging may have issues, Have you noticed any problems with the Enc Plug temp logging?
None so far.. Been running it since I created this PR, seems to be working great.
looks like there is no conflict with python 2, so i'll merge while i don't finish 3.x version