mirror of
https://github.com/borgbackup/borg.git
synced 2025-03-04 02:28:34 +00:00
Default to 'utf-8' as stderr and stdout encoding
This commit is contained in:
parent
885823fdbd
commit
3eb211b442
1 changed files with 2 additions and 2 deletions
|
@ -27,7 +27,7 @@ class Archiver(object):
|
||||||
def print_error(self, msg, *args):
|
def print_error(self, msg, *args):
|
||||||
msg = args and msg % args or msg
|
msg = args and msg % args or msg
|
||||||
if hasattr(sys.stderr, 'encoding'):
|
if hasattr(sys.stderr, 'encoding'):
|
||||||
msg = msg.encode(sys.stderr.encoding, 'ignore')
|
msg = msg.encode(sys.stderr.encoding or 'utf-8', 'ignore')
|
||||||
self.exit_code = 1
|
self.exit_code = 1
|
||||||
print >> sys.stderr, msg
|
print >> sys.stderr, msg
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ class Archiver(object):
|
||||||
if self.verbose:
|
if self.verbose:
|
||||||
msg = args and msg % args or msg
|
msg = args and msg % args or msg
|
||||||
if hasattr(sys.stdout, 'encoding'):
|
if hasattr(sys.stdout, 'encoding'):
|
||||||
msg = msg.encode(sys.stdout.encoding, 'ignore')
|
msg = msg.encode(sys.stdout.encoding or 'utf-8', 'ignore')
|
||||||
if kw.get('newline', True):
|
if kw.get('newline', True):
|
||||||
print msg
|
print msg
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Reference in a new issue