From 5d140947803f81c23de82554e4fba99b3c7e4156 Mon Sep 17 00:00:00 2001 From: southerntofu Date: Mon, 7 Mar 2022 14:07:05 -0500 Subject: Don't silently traceback when trying to message someone privately in a MUC Using jidstr with slashes "escaped" as backslashes is clever, but _check_and_create_log_dir still expects a parsable JID to check config. --- poezio/logger.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/poezio/logger.py b/poezio/logger.py index 21667924..85b861e1 100644 --- a/poezio/logger.py +++ b/poezio/logger.py @@ -196,6 +196,8 @@ class Logger: """ if not config.get_by_tabname('use_log', JID(jid)): return None + # POSIX filesystems don't support / in filename, so we replace it with a backslash + jid = str(jid).replace('/', '\\') try: self.log_dir.mkdir(parents=True, exist_ok=True) except OSError: @@ -255,7 +257,7 @@ class Logger: if jidstr in self._fds.keys(): fd = self._fds[jidstr] else: - option_fd = self._check_and_create_log_dir(jidstr) + option_fd = self._check_and_create_log_dir(jid) if option_fd is None: return True fd = option_fd -- cgit v1.2.3