diff --git a/HISTORY.rst b/HISTORY.rst index 6aa1832c..2607fb41 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -15,6 +15,7 @@ PlatformIO Core 5 - Improved directory interpolation (``${platformio.***_dir}``) in `"platformio.ini" `__ configuration file (`issue #3934 `_) - Ignore resolving of SCons variables (e.g., ``${SOURCE.get_abspath()}``) when preprocessing interpolations (`issue #3933 `_) - Fixed an issue when the "$PROJECT_DIR" variable was not properly replaced in the `debug_server `__ option (`issue #4086 `_) +- Fixed an issue when `PIO Remote `__ device monitor crashes on the first keypress (`issue #3832 `_) 5.2.2 (2021-10-20) diff --git a/platformio/commands/remote/client/device_monitor.py b/platformio/commands/remote/client/device_monitor.py index 4c68f85f..b880d270 100644 --- a/platformio/commands/remote/client/device_monitor.py +++ b/platformio/commands/remote/client/device_monitor.py @@ -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"")