New submission from Manuel Jacob <m...@manueljacob.de>:

Calling warnings.warn() will write to a file, but not flush it. On Python 3.9+, 
it won’t usually be a problem because the file is most likely stderr, which is 
always line-buffered. However, on older Python versions or if a different file 
is used, the current behavior unnecessarily delays the output of the warning. 
This is especially problematic if the warning is about buffering behavior 
itself, as e.g. caused by `open('/tmp/test', 'wb', buffering=1)`.

----------
messages: 371934
nosy: mjacob
priority: normal
severity: normal
status: open
title: Flush file after warning is written

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue41051>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to