diff options
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2018-07-08 10:58:00 +0200 |
---|---|---|
committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2018-07-08 10:58:00 +0200 |
commit | 19cc6229a207394a5a0f3e1181f48a32a11de9ef (patch) | |
tree | 55e2e45f83c397a6eceb373b97d8be7a56fbe5ca | |
parent | cabc8fcd944bf6c915cd82da2405375f5863ebf8 (diff) | |
download | poezio-19cc6229a207394a5a0f3e1181f48a32a11de9ef.tar.gz poezio-19cc6229a207394a5a0f3e1181f48a32a11de9ef.tar.bz2 poezio-19cc6229a207394a5a0f3e1181f48a32a11de9ef.tar.xz poezio-19cc6229a207394a5a0f3e1181f48a32a11de9ef.zip |
logger: Use pathlib.Path.open() instead of open().
-rw-r--r-- | poezio/logger.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/poezio/logger.py b/poezio/logger.py index cda190b3..c14b9036 100644 --- a/poezio/logger.py +++ b/poezio/logger.py @@ -120,7 +120,7 @@ class Logger(object): return filename = log_dir / room try: - fd = open(filename, 'a', encoding='utf-8') + fd = filename.open('a', encoding='utf-8') self._fds[room] = fd return fd except IOError: @@ -149,7 +149,7 @@ class Logger(object): filename = log_dir / jid try: - fd = open(filename, 'rb') + fd = filename.open('rb') except FileNotFoundError: log.info( 'Non-existing log file (%s)', @@ -228,8 +228,8 @@ class Logger(object): filename = log_dir / 'roster.log' if not self._roster_logfile: try: - self._roster_logfile = open( - filename, 'a', encoding='utf-8') + self._roster_logfile = filename.open( + 'a', encoding='utf-8') except IOError: log.error( 'Unable to create the log file (%s)', |