File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,9 @@ Bug fixes:
51
51
52
52
* Do not skip physical checks if the newline is escaped. (Issue #319)
53
53
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
+
54
57
55
58
1.5.7 (2014-05-29)
56
59
------------------
Original file line number Diff line number Diff line change @@ -1704,6 +1704,14 @@ def get_file_results(self):
1704
1704
print (re .sub (r'\S' , ' ' , line [:offset ]) + '^' )
1705
1705
if self ._show_pep8 and doc :
1706
1706
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 ()
1707
1715
return self .file_errors
1708
1716
1709
1717
Original file line number Diff line number Diff line change @@ -16,6 +16,9 @@ class PseudoFile(list):
16
16
def getvalue (self ):
17
17
return '' .join (self )
18
18
19
+ def flush (self ):
20
+ pass
21
+
19
22
20
23
class TestReport (StandardReport ):
21
24
"""Collect the results for the tests."""
You can’t perform that action at this time.
0 commit comments