This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author xtreak
Recipients andriusl, vinay.sajip, xtreak
Date 2019-03-05.11:57:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1551787021.83.0.805979644309.issue36193@roundup.psfhosted.org>
In-reply-to
Content
A little simplified reproducer :  

import io, contextlib, logging

message = 'dummy test'

with io.StringIO() as sio:
    with contextlib.redirect_stdout(sio), contextlib.redirect_stderr(sio):
        logging.warning(message)
        output = sio.getvalue()
    print(output)

logging.warning(message)


$ python3.7 /tmp/foo.py
WARNING:root:dummy test

--- Logging error ---
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/logging/__init__.py", line 1036, in emit
    stream.write(msg)
ValueError: I/O operation on closed file
Call stack:
  File "/tmp/foo.py", line 11, in <module>
    logging.warning(message)
Message: 'dummy test'
Arguments: ()
History
Date User Action Args
2019-03-05 11:57:01xtreaksetrecipients: + xtreak, vinay.sajip, andriusl
2019-03-05 11:57:01xtreaksetmessageid: <1551787021.83.0.805979644309.issue36193@roundup.psfhosted.org>
2019-03-05 11:57:01xtreaklinkissue36193 messages
2019-03-05 11:57:01xtreakcreate