Starting from Python 3.10, the implementation of logging.FileHandler._open has
changed to use builtin open() unconditionally. Rather than continuing to
maintain a copy-pasted version of that method here, let's just remove it so it
can be inherited instead.
diff -ur ConcurrentLogHandler-0.9.1/src/cloghandler.py ConcurrentLogHandler-0.9.1.patched/src/cloghandler.py
--- ConcurrentLogHandler-0.9.1/src/cloghandler.py 2013-07-11 12:23:26.000000000 +1000
+++ ConcurrentLogHandler-0.9.1.patched/src/cloghandler.py 2021-08-01 18:40:45.341360592 +1000
@@ -152,21 +152,6 @@
lock_file += ".lock"
self.stream_lock = open(lock_file,"w")
- def _open(self, mode=None):
- """
- Open the current base file with the (original) mode and encoding.
- Return the resulting stream.
-
- Note: Copied from stdlib. Added option to override 'mode'
- """
- if mode is None:
- mode = self.mode
- if self.encoding is None:
- stream = open(self.baseFilename, mode)
- else:
- stream = codecs.open(self.baseFilename, mode, self.encoding)
- return stream
-
def _close(self):
""" Close file stream. Unlike close(), we don't tear anything down, we
expect the log to be re-opened after rotation."""