[issue44410] Exception in AsyncMock side_effect cases incorrect refcount

2021-06-13 Thread Daniel Andersson
New submission from Daniel Andersson : Dear maintainers, I discovered an unexpected behavior when the `side_effect` of an `AsyncMock` includes an exception. The test case below fails but I expected it to pass: ``` import sys import unittest from unittest.mock import AsyncMock class A

[issue38781] Clear buffer in MemoryHandler flush

2019-11-13 Thread Daniel Andersson
Daniel Andersson added the comment: The suggested change has been merged. I'm closing this issue. Thank you Vinay Sajip for reviewing. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python t

[issue38781] Clear buffer in MemoryHandler flush

2019-11-12 Thread Daniel Andersson
Change by Daniel Andersson : -- keywords: +patch pull_requests: +16642 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17132 ___ Python tracker <https://bugs.python.org/issu

[issue38781] Clear buffer in MemoryHandler flush

2019-11-12 Thread Daniel Andersson
New submission from Daniel Andersson : The `logging.handlers.MemoryHandler` has a method `flush` which clears the buffer by assigning an empty list literal: self.buffer = [] This forces the buffer to be a list instance. My suggestion is to clear the buffer like this instead

[issue38235] Docs of logging module says argument is named "lvl". TypeError.

2019-09-20 Thread Daniel Andersson
New submission from Daniel Andersson : How to reproduce: >>> import logging >>> logging.disable(lvl=logging.ERROR) Traceback (most recent call last): File "", line 1, in TypeError: disable() got an unexpected keyword argument 'lvl' The correct keyw

[issue21297] csv.skipinitialspace only skips spaces, not "whitespace" in general

2014-04-20 Thread Daniel Andersson
Daniel Andersson added the comment: No, multiple spaces are ignored as advertised (according to actual tests; not just reading the code), but only spaces (U+0020) and not e.g. tabs (U+0009), which are also included in the term "whitespace", along with several other characters. I

[issue21297] skipinitialspace in the csv module only skips spaces, not "whitespace" in general

2014-04-18 Thread Daniel Andersson
New submission from Daniel Andersson: Regarding the `skipinitialspace` parameter to the different CSV reader dialects in the `csv` module, the official documentation asserts: When True, whitespace immediately following the delimiter is ignored. and the `help(csv)` style module