diff --git a/plugins/__init__.py b/plugins/__init__.py index 5796de465..51e491eb9 100644 --- a/plugins/__init__.py +++ b/plugins/__init__.py @@ -251,7 +251,8 @@ class ChannelUserDB(ChannelUserDictionary): log.debug('Exception: %s', utils.exnToString(e)) def flush(self): - fd = utils.file.AtomicFile(self.filename, makeBackupIfSmaller=False) + mode = 'wb' if utils.minisix.PY2 else 'w' + fd = utils.file.AtomicFile(self.filename, mode, makeBackupIfSmaller=False) writer = csv.writer(fd) items = list(self.items()) if not items: