[issue17508] logging.config.ConvertingDict issue with MemoryHandler
Pierre Le Marre added the comment: Thank you for the tip! I just try it, it works. This behavior is not documented, so it is quite confusing. I try also to use ``collections.OrderedDict``, as a quick fix, but it does not work. It seems we need here a simple resolution order. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17508 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17508] logging.config.ConvertingDict issue with MemoryHandler
New submission from Pierre Le Marre: Hi, I use Python 3.2.3 and Python 3.3.0 on Windows 7 64 bits. I have an issue with the short script enclosed. I use the module logging to get a log file with logging.FileHandler. There were some issues about the file access on Windows, so I added a buffer with logging.handlers.MemoryHandler. I configure the logging using logging.config.dictConfig. The issue appears when it comes to flush the MemoryHandler, either by reaching the capacity or by calling logging.shutdown(). Please find hereinbelow the traceback: Traceback (most recent call last): File C:\temp\bug-logging.py, line 38, in module logger.info(n) File C:\Python32\lib\logging\__init__.py, line 1232, in info self._log(INFO, msg, args, **kwargs) File C:\Python32\lib\logging\__init__.py, line 1364, in _log self.handle(record) File C:\Python32\lib\logging\__init__.py, line 1374, in handle self.callHandlers(record) File C:\Python32\lib\logging\__init__.py, line 1436, in callHandlers hdlr.handle(record) File C:\Python32\lib\logging\__init__.py, line 835, in handle self.emit(record) File C:\Python32\lib\logging\handlers.py, line 1090, in emit self.flush() File C:\Python32\lib\logging\handlers.py, line 1150, in flush self.target.handle(record) AttributeError: 'ConvertingDict' object has no attribute 'handle' -- components: Library (Lib) files: bug-logging.py messages: 184866 nosy: plemarre priority: normal severity: normal status: open title: logging.config.ConvertingDict issue with MemoryHandler type: crash versions: Python 3.2, Python 3.3 Added file: http://bugs.python.org/file29527/bug-logging.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17508 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15545] sqlite3.Connection.iterdump() does not work with row_factory = sqlite3.Row
Pierre Le Marre added the comment: Thanks for the patch. In which version will be your patch integrated? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15545 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15545] sqlite3.Connection.iterdump() does not work with row_factory = sqlite3.Row
Pierre Le Marre added the comment: By the way, this issue does not appear with Python 3.2.2. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15545 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15545] sqlite3.Connection.iterdump() does not work with row_factory = sqlite3.Row
Changes by Pierre Le Marre lema...@eifer.org: -- components: None nosy: plemarre priority: normal severity: normal status: open title: sqlite3.Connection.iterdump() does not work with row_factory = sqlite3.Row type: crash versions: Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15545 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15545] sqlite3.Connection.iterdump() does not work with row_factory = sqlite3.Row
Pierre Le Marre added the comment: I use Python 3.2.3 on GNU/Linux 64bits (openSUSE 12.2). I have created an in-memory connection with the following code: conn = sqlite3.connect(:memory:, detect_types=sqlite3.PARSE_DECLTYPES, check_same_thread=False) conn.row_factory = sqlite3.Row Then I have filled the database, but when it comes to copy it via conn.iterdump(), it crashed with the following message: File /usr/lib64/python3.2/sqlite3/dump.py, line 30, in _iterdump for table_name, type, sql in sorted(schema_res.fetchall()): TypeError: unorderable types: sqlite3.Row() sqlite3.Row() It seems that the error appears because of the use of sorted(). In fact, if I don't change conn.row_factory or if I use a custom class _Row implementing __lt__ method (see below) this error does not appear. class _Row(sqlite3.Row): def __lt__(self, x): return False -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15545 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com