Multiprocessing issue when redirecting stdout
Running 2.2.5 on linux, when I run flake8 on multiple files with a lot of violations and redirect the output at all (less, grep, >file) I often see junk in the output due to some issue with multiprocessing.
$ for i in `seq 0 1000`; do echo test$i >> testcase.py; done
$ .tox/flake8/bin/flake8 testcase.py testcase.py testcase.py | head -5
testcase.py:1:1: F821 undefined name 'test0'
testcase.py:2:1: F821 undefined name 'test1'
testcase.py:3:1: F821 undefined name 'test2'
testcase.py:4:1: F821 undefined name 'test3'
Grepping for junk:
$ .tox/flake8/bin/flake8 testcase.py testcase.py testcase.py | grep -E '^[^t]'
821 undefined name 'test422'
:256:1: F821 undefined name 'test255'
py:674:1: F821 undefined name 'test673'
'test756'
$ .tox/flake8/bin/flake8 testcase.py testcase.py testcase.py | grep -E '^[^t]'
efined name 'test87'
$ .tox/flake8/bin/flake8 testcase.py testcase.py testcase.py | grep -E '^[^t]'
821 undefined name 'test422'
'
-j1 fixes it:
$ .tox/flake8/bin/flake8 -j1 testcase.py testcase.py testcase.py | grep -E '^[^t]'
$ .tox/flake8/bin/flake8 -j1 testcase.py testcase.py testcase.py | grep -E '^[^t]'
$ .tox/flake8/bin/flake8 -j1 testcase.py testcase.py testcase.py | grep -E '^[^t]'
$ .tox/flake8/bin/pip freeze
argparse==1.2.1
flake8==2.2.5
mccabe==0.3
pep8==1.5.7
pyflakes==0.8.1
six==1.8.0
wsgiref==0.1.2