Message328269
logging.StreamHandler contains the following code:
stream.write(msg)
stream.write(self.terminator)
stream.flush()
When sys.stderr (or whatever other stream) is unbuffered, this results in two system calls and allows log records from different processes to concatenate on the same line in the output stream (followed by multiple newlines). This issue is new in Python 3.7, as stdout and stderr became "truly unbuffered" (cf. #30404).
As a simple solution, I believe the following would fix the issue and also be backward compatible:
stream.write(msg + self.terminator)
stream.flush() |
|
| Date |
User |
Action |
Args |
| 2018-10-22 18:51:21 | josnyder | set | recipients:
+ josnyder |
| 2018-10-22 18:51:21 | josnyder | set | messageid: <1540234281.84.0.788709270274.issue35046@psf.upfronthosting.co.za> |
| 2018-10-22 18:51:21 | josnyder | link | issue35046 messages |
| 2018-10-22 18:51:21 | josnyder | create | |
|