File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,6 +51,9 @@ Bug fixes:
5151
5252* Do not skip physical checks if the newline is escaped. (Issue #319)
5353
54+ * Flush sys.stdout to avoid race conditions with printing. See flake8 bug:
55+ https://gitlab.com/pycqa/flake8/issues/17 for more details. (Issue #363)
56+
5457
55581.5.7 (2014-05-29)
5659------------------
Original file line number Diff line number Diff line change @@ -1704,6 +1704,14 @@ def get_file_results(self):
17041704 print (re .sub (r'\S' , ' ' , line [:offset ]) + '^' )
17051705 if self ._show_pep8 and doc :
17061706 print (' ' + doc .strip ())
1707+
1708+ # stdout is block buffered when not stdout.isatty().
1709+ # line can be broken where buffer boundary since other processes
1710+ # write to same file.
1711+ # flush() after print() to avoid buffer boundary.
1712+ # Typical buffer size is 8192. line written safely when
1713+ # len(line) < 8192.
1714+ sys .stdout .flush ()
17071715 return self .file_errors
17081716
17091717
Original file line number Diff line number Diff line change @@ -16,6 +16,9 @@ class PseudoFile(list):
1616 def getvalue (self ):
1717 return '' .join (self )
1818
19+ def flush (self ):
20+ pass
21+
1922
2023class TestReport (StandardReport ):
2124 """Collect the results for the tests."""
You can’t perform that action at this time.
0 commit comments