Repository: borgbackup/borg

Issue:
flake8 (pyflakes) hangs all vagrant machines, fails on travis-ci
pyflakes 2.1.0 is broken, causing lots of issues.

we need to downgrade if they don't release a fix ASAP.

https://github.com/PyCQA/pyflakes/issues/422


Discussion:
```
  File "/usr/lib/python3.5/multiprocessing/pool.py", line 429, in _handle_results
    task = get()
  File "/usr/lib/python3.5/multiprocessing/connection.py", line 251, in recv
    return ForkingPickler.loads(buf.getbuffer())
  File "/vagrant/borg/borg/.tox/flake8/lib/python3.5/site-packages/flake8/exceptions.py", line 86, in __init__
    self.original_exception = kwargs.pop("exception")
KeyError: 'exception'



^CERROR: KEYBOARDINTERRUPT
Traceback (most recent call last):
  File "/usr/lib/python3.5/multiprocessing/pool.py", line 680, in next
    item = self._items.popleft()
IndexError: pop from an empty deque

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/vagrant/borg/borg/.tox/flake8/lib/python3.5/site-packages/flake8/checker.py", line 294, in run_parallel
    for ret in pool_map:
  File "/usr/lib/python3.5/multiprocessing/pool.py", line 314, in <genexpr>
    return (item for chunk in result for item in chunk)
  File "/usr/lib/python3.5/multiprocessing/pool.py", line 684, in next
    self._cond.wait(timeout)
  File "/usr/lib/python3.5/threading.py", line 293, in wait
    waiter.acquire()
KeyboardInterrupt

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/vagrant/borg/borg/.tox/flake8/bin/flake8", line 10, in <module>
    sys.exit(main())
  File "/vagrant/borg/borg/.tox/flake8/lib/python3.5/site-packages/flake8/main/cli.py", line 18, in main
    app.run(argv)
  File "/vagrant/borg/borg/.tox/flake8/lib/python3.5/site-packages/flake8/main/application.py", line 393, in run
    self._run(argv)
  File "/vagrant/borg/borg/.tox/flake8/lib/python3.5/site-packages/flake8/main/application.py", line 381, in _run
    self.run_checks()
  File "/vagrant/borg/borg/.tox/flake8/lib/python3.5/site-packages/flake8/main/application.py", line 300, in run_checks
    self.file_checker_manager.run()
  File "/vagrant/borg/borg/.tox/flake8/lib/python3.5/site-packages/flake8/checker.py", line 330, in run
    self.run_parallel()
  File "/vagrant/borg/borg/.tox/flake8/lib/python3.5/site-packages/flake8/checker.py", line 303, in run_parallel
    pool.terminate()
  File "/usr/lib/python3.5/multiprocessing/pool.py", line 505, in terminate
    self._terminate()
  File "/usr/lib/python3.5/multiprocessing/util.py", line 186, in __call__
    res = self._callback(*self._args, **self._kwargs)
  File "/usr/lib/python3.5/multiprocessing/pool.py", line 537, in _terminate_pool
    assert result_handler.is_alive() or len(cache) == 0
AssertionError
ERROR: keyboardinterrupt
```
this patch fixes your testsuite and pyflakes btw:

```diff
diff --git a/src/borg/testsuite/archiver.py b/src/borg/testsuite/archiver.py
index 8b8bcf03..845fcf01 100644
--- a/src/borg/testsuite/archiver.py
+++ b/src/borg/testsuite/archiver.py
@@ -2857,7 +2857,7 @@ def test_export_tar_strip_components_links(self):
 
     @requires_hardlinks
     @requires_gnutar
-    def test_extract_hardlinks(self):
+    def test_extract_hardlinks_gnutar(self):
         self._extract_hardlinks_setup()
         self.cmd('export-tar', self.repository_location + '::test', 'output.tar', 'input/dir1')
         with changedir('output'):
```

You have two tests which are clobbering each other (the first test _never ever runs_ due to this)

Resolving patch:
diff --git a/src/borg/testsuite/archiver.py b/src/borg/testsuite/archiver.py
--- a/src/borg/testsuite/archiver.py
+++ b/src/borg/testsuite/archiver.py
@@ -2868,7 +2868,7 @@ def test_export_tar_strip_components_links(self):
 
     @requires_hardlinks
     @requires_gnutar
-    def test_extract_hardlinks(self):
+    def test_extract_hardlinks_tar(self):
         self._extract_hardlinks_setup()
         self.cmd('export-tar', self.repository_location + '::test', 'output.tar', 'input/dir1')
         with changedir('output'):


Test patch: