diff --git a/CHANGES.rst b/CHANGES.rst index 54992f3..7896ba9 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,9 @@ +unreleased +========== + +- Ignore corrupted packets coming from watchman that occur in semi-random + scenarios. See https://github.com/Pylons/hupper/pull/38 + 1.3 (2018-05-21) ================ diff --git a/src/hupper/watchman.py b/src/hupper/watchman.py index 00b923f..743461a 100644 --- a/src/hupper/watchman.py +++ b/src/hupper/watchman.py @@ -132,7 +132,11 @@ def _recv(self): line = self._readline() if not PY2: line = line.decode('utf8') - return json.loads(line) + try: + return json.loads(line) + except Exception: # pragma: no cover + self.logger.info('ignoring corrupted payload from watchman') + return {} def _send(self, msg): cmd = json.dumps(msg)