diff --git a/attic/archive.py b/attic/archive.py index 34f8b7fd6..aad34c56b 100644 --- a/attic/archive.py +++ b/attic/archive.py @@ -497,7 +497,6 @@ def report_progress(self, msg, error=False): if error: self.error_found = True print(msg, file=sys.stderr if error else sys.stdout) - sys.stderr.flush() def identify_key(self, repository): cdata = repository.get(next(self.chunks.iteritems())[0]) diff --git a/attic/archiver.py b/attic/archiver.py index 3bf6f6e6a..6da0cae79 100644 --- a/attic/archiver.py +++ b/attic/archiver.py @@ -611,8 +611,8 @@ def run(self, args=None): def main(): # Make sure stdout and stderr have errors='replace') to avoid unicode # issues when print()-ing unicode file names - sys.stdout = io.TextIOWrapper(sys.stdout.buffer, sys.stdout.encoding, 'replace', line_buffering=sys.stdout.line_buffering) - sys.stderr = io.TextIOWrapper(sys.stderr.buffer, sys.stderr.encoding, 'replace', line_buffering=sys.stderr.line_buffering) + 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) archiver = Archiver() try: exit_code = archiver.run(sys.argv[1:]) diff --git a/attic/repository.py b/attic/repository.py index 05105da61..b3e31a63f 100644 --- a/attic/repository.py +++ b/attic/repository.py @@ -244,7 +244,6 @@ def report_error(msg): nonlocal error_found error_found = True print(msg, file=sys.stderr) - sys.stderr.flush() assert not self._active_txn try: