Repository: borgbackup/borg

Issue:
python 3.4.0 test failures
```
    freebsd64: =================================== FAILURES ===================================
    freebsd64: __________________ ArchiverTestCase.test_create_pattern_root ___________________
    freebsd64: [gw2] freebsd10 -- Python 3.4.0 /vagrant/borg/borg/.tox/py34/bin/python3.4
    freebsd64: self = <borg.testsuite.archiver.ArchiverTestCase testMethod=test_create_pattern_root>
    freebsd64:     def test_create_pattern_root(self):
    freebsd64:         """test create with only a root pattern"""
    freebsd64:         self.cmd('init', '--encryption=repokey', self.repository_location)
    freebsd64:         self.create_regular_file('file1', size=1024 * 80)
    freebsd64:         self.create_regular_file('file2', size=1024 * 80)
    freebsd64: >       output = self.cmd('create', '-v', '--list', '--pattern=R input', self.repository_location + '::test')
    freebsd64: .tox/py34/lib/python3.4/site-packages/borg/testsuite/archiver.py
    freebsd64: :1020: 
    freebsd64: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    freebsd64: .tox/py34/lib/python3.4/site-packages/borg/testsuite/archiver.py
    freebsd64: :292: in cmd
    freebsd64:     self.assert_equal(ret, exit_code)
    freebsd64: E   AssertionError: 2 != 0
    freebsd64: ----------------------------- Captured stdout call -----------------------------
    freebsd64: usage: -c [-V] [-h] [--critical] [--error] [--warning] [--info] [--debug]
    freebsd64:           [--debug-topic TOPIC] [-p] [--log-json] [--lock-wait SECONDS]
    freebsd64:           [--show-version] [--show-rc] [--umask M] [--remote-path PATH]
    freebsd64:           [--remote-ratelimit RATE] [--consider-part-files]
    freebsd64:           [--debug-profile FILE]
    freebsd64:           <command> ...
    freebsd64: -c: error: Need at least one PATH argument.
```


Discussion:
borgbackup==1.1.5.dev69+gcbb19ca4
fails on 3.4.0, works on 3.4.3+, 3.5.0 and 3.6.0.
same on darwin, linux.
smells like an argparse bug. But where does the `-c` come from?

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
@@ -58,6 +58,8 @@
 from .upgrader import attic_repo
 from . import key
 
+# 3.4.3 == first version with argparse bugfix for nargs='*' and 0 arguments given
+argparse_nargs0_fixed = sys.version_info >= (3, 4, 3)
 
 src_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
 
@@ -1017,9 +1019,10 @@ def test_create_pattern_root(self):
         self.cmd('init', '--encryption=repokey', self.repository_location)
         self.create_regular_file('file1', size=1024 * 80)
         self.create_regular_file('file2', size=1024 * 80)
-        output = self.cmd('create', '-v', '--list', '--pattern=R input', self.repository_location + '::test')
-        self.assert_in("A input/file1", output)
-        self.assert_in("A input/file2", output)
+        if argparse_nargs0_fixed:
+            output = self.cmd('create', '-v', '--list', '--pattern=R input', self.repository_location + '::test')
+            self.assert_in("A input/file1", output)
+            self.assert_in("A input/file2", output)
 
     def test_create_pattern(self):
         """test file patterns during create"""


Test patch: