|
@@ -3,7 +3,6 @@ import collections
|
|
import functools
|
|
import functools
|
|
import hashlib
|
|
import hashlib
|
|
import inspect
|
|
import inspect
|
|
-import io
|
|
|
|
import logging
|
|
import logging
|
|
import os
|
|
import os
|
|
import re
|
|
import re
|
|
@@ -41,6 +40,7 @@ from .helpers import dir_is_tagged, is_slow_msgpack, yes, sysinfo
|
|
from .helpers import log_multi
|
|
from .helpers import log_multi
|
|
from .helpers import parse_pattern, PatternMatcher, PathPrefixPattern
|
|
from .helpers import parse_pattern, PatternMatcher, PathPrefixPattern
|
|
from .helpers import signal_handler
|
|
from .helpers import signal_handler
|
|
|
|
+from .helpers import ErrorIgnoringTextIOWrapper
|
|
from .item import Item
|
|
from .item import Item
|
|
from .key import key_creator, RepoKey, PassphraseKey
|
|
from .key import key_creator, RepoKey, PassphraseKey
|
|
from .platform import get_flags
|
|
from .platform import get_flags
|
|
@@ -1047,7 +1047,7 @@ class Archiver:
|
|
Cache.break_lock(repository)
|
|
Cache.break_lock(repository)
|
|
return self.exit_code
|
|
return self.exit_code
|
|
|
|
|
|
- helptext = {}
|
|
|
|
|
|
+ helptext = collections.OrderedDict()
|
|
helptext['patterns'] = textwrap.dedent('''
|
|
helptext['patterns'] = textwrap.dedent('''
|
|
Exclusion patterns support four separate styles, fnmatch, shell, regular
|
|
Exclusion patterns support four separate styles, fnmatch, shell, regular
|
|
expressions and path prefixes. By default, fnmatch is used. If followed
|
|
expressions and path prefixes. By default, fnmatch is used. If followed
|
|
@@ -1796,7 +1796,7 @@ class Archiver:
|
|
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
help='break repository and cache locks')
|
|
help='break repository and cache locks')
|
|
subparser.set_defaults(func=self.do_break_lock)
|
|
subparser.set_defaults(func=self.do_break_lock)
|
|
- subparser.add_argument('location', metavar='REPOSITORY',
|
|
|
|
|
|
+ subparser.add_argument('location', metavar='REPOSITORY', nargs='?', default='',
|
|
type=location_validator(archive=False),
|
|
type=location_validator(archive=False),
|
|
help='repository for which to break the locks')
|
|
help='repository for which to break the locks')
|
|
|
|
|
|
@@ -2251,8 +2251,8 @@ def main(): # pragma: no cover
|
|
|
|
|
|
# Make sure stdout and stderr have errors='replace' to avoid unicode
|
|
# Make sure stdout and stderr have errors='replace' to avoid unicode
|
|
# issues when print()-ing unicode file names
|
|
# issues when print()-ing unicode file names
|
|
- sys.stdout = io.TextIOWrapper(sys.stdout.buffer, sys.stdout.encoding, 'replace', line_buffering=True)
|
|
|
|
- sys.stderr = io.TextIOWrapper(sys.stderr.buffer, sys.stderr.encoding, 'replace', line_buffering=True)
|
|
|
|
|
|
+ sys.stdout = ErrorIgnoringTextIOWrapper(sys.stdout.buffer, sys.stdout.encoding, 'replace', line_buffering=True)
|
|
|
|
+ sys.stderr = ErrorIgnoringTextIOWrapper(sys.stderr.buffer, sys.stderr.encoding, 'replace', line_buffering=True)
|
|
setup_signal_handlers()
|
|
setup_signal_handlers()
|
|
archiver = Archiver()
|
|
archiver = Archiver()
|
|
msg = None
|
|
msg = None
|