I'm not 100% sure this is a bug, or just something that we can't do anything about. But it's possible that a different internal implementation would allow the following code to execute.
This code succeeds:
import sinon
import logging
log = logging.getLogger('test')
stub = sinon.stub(log, 'warning')
This code fails:
import sinon
import logging
import sys
log = logging.getLogger('test')
streamHandler = logging.StreamHandler(sys.stdout)
log.addHandler(streamHandler)
stub = sinon.stub(log, 'warning') # raises "TypeError: can't pickle thread.lock objects"
I'm not 100% sure this is a bug, or just something that we can't do anything about. But it's possible that a different internal implementation would allow the following code to execute.
This code succeeds:
This code fails: