Fixed an issue when PIO Remote device monitor crashes on the first keypress // Resolve #3832

This commit is contained in:
Ivan Kravets
2021-10-25 13:24:36 +03:00
parent 4943504898
commit f1638c9cd7
2 changed files with 4 additions and 3 deletions

View File

@ -15,6 +15,7 @@ PlatformIO Core 5
- Improved directory interpolation (``${platformio.***_dir}``) in `"platformio.ini" <https://docs.platformio.org/page/projectconf.html>`__ configuration file (`issue #3934 <https://github.com/platformio/platformio-core/issues/3934>`_)
- Ignore resolving of SCons variables (e.g., ``${SOURCE.get_abspath()}``) when preprocessing interpolations (`issue #3933 <https://github.com/platformio/platformio-core/issues/3933>`_)
- Fixed an issue when the "$PROJECT_DIR" variable was not properly replaced in the `debug_server <https://docs.platformio.org/page/projectconf/section_env_debug.html#debug-server>`__ option (`issue #4086 <https://github.com/platformio/platformio-core/issues/4086>`_)
- Fixed an issue when `PIO Remote <https://docs.platformio.org/page/plus/pio-remote.html>`__ device monitor crashes on the first keypress (`issue #3832 <https://github.com/platformio/platformio-core/issues/3832>`_)
5.2.2 (2021-10-20)

View File

@ -84,7 +84,7 @@ class DeviceMonitorClient( # pylint: disable=too-many-instance-attributes
self._ac_id = None
self._d_acread = None
self._d_acwrite = None
self._acwrite_buffer = ""
self._acwrite_buffer = b""
def agent_pool_ready(self):
d = task.deferLater(
@ -226,7 +226,7 @@ class DeviceMonitorClient( # pylint: disable=too-many-instance-attributes
return
data = self._acwrite_buffer
self._acwrite_buffer = ""
self._acwrite_buffer = b""
try:
d = self.agentpool.callRemote("acwrite", self._agent_id, self._ac_id, data)
d.addCallback(self.cb_acwrite_result)
@ -237,4 +237,4 @@ class DeviceMonitorClient( # pylint: disable=too-many-instance-attributes
def cb_acwrite_result(self, result):
assert result > 0
if self._acwrite_buffer:
self.acwrite_data("")
self.acwrite_data(b"")