def test_encoding(self):
        """
        Default encoding is C{sys.getdefaultencoding()} if not set.
        """
        f = LoggingFile(self.logger)
        self.assertEqual(f.encoding, sys.getdefaultencoding())

        f = LoggingFile(self.logger, encoding="utf-8")
        self.assertEqual(f.encoding, "utf-8")

        Default encoding is C{sys.getdefaultencoding()} if not set.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/logger/test/test_io.py