Fixed an issue "the JSON object must be str, not 'bytes'" when PIO Home is used with Python 3.5 // Resolve #3396

This commit is contained in:
Ivan Kravets
2020-02-29 21:59:10 +02:00
parent d3e151feeb
commit eee12b9b66
2 changed files with 3 additions and 0 deletions

View File

@ -10,6 +10,7 @@ PlatformIO Core 4
~~~~~~~~~~~~~~~~~~
* Fixed an issue when quitting from PlatformIO IDE does not shutdown PIO Home server
* Fixed an issue "the JSON object must be str, not 'bytes'" when PIO Home is used with Python 3.5 (`issue #3396 <https://github.com/platformio/platformio-core/issues/3396>`_)
4.2.1 (2020-02-17)
~~~~~~~~~~~~~~~~~~

View File

@ -146,6 +146,8 @@ class PIOCoreRPC(object):
raise Exception(text)
if not to_json:
return text
if is_bytes(out):
out = out.decode()
try:
return json.loads(out)
except ValueError as e: