Message328269
| Author |
josnyder |
| Recipients |
josnyder |
| Date |
2018年10月22日.18:51:21 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1540234281.84.0.788709270274.issue35046@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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() |
|
History
|
|---|
| 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 |
|