From 0c5e3531748d231e34ef6ecf8581ac20fd956b25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Klein?= Date: Mon, 10 Sep 2018 15:23:04 +0200 Subject: [PATCH] Fix bytes <> str warnings --- src/watchdog/observers/inotify_c.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/watchdog/observers/inotify_c.py b/src/watchdog/observers/inotify_c.py index 0dc7b5024..ba99bd5ad 100644 --- a/src/watchdog/observers/inotify_c.py +++ b/src/watchdog/observers/inotify_c.py @@ -462,7 +462,7 @@ def __init__(self, wd, mask, cookie, name, src_path): self._wd = wd self._mask = mask self._cookie = cookie - self._name = name + self._name = name.decode() self._src_path = src_path @property @@ -571,5 +571,6 @@ def _get_mask_string(mask): def __repr__(self): mask_string = self._get_mask_string(self.mask) - s = "" - return s % (self.src_path, self.wd, mask_string, self.cookie, self.name) + s = '<%s: src_path=%r, wd=%d, mask=%s, cookie=%d, name=%s>' + return s % (type(self).__name__, self.src_path, self.wd, mask_string, + self.cookie, self.name)