Merge pull request #77 from dsblank/master

8556: ValueError: underlying buffer has been detached
This commit is contained in:
Doug Blank 2015-12-13 15:10:43 -05:00
commit a0bf429b4c
2 changed files with 1 additions and 13 deletions

View File

@ -409,18 +409,6 @@ def run():
else: else:
# CLI use of Gramps # CLI use of Gramps
# Ensure that output is encoded correctly to stdout and
# stderr. This is much less cumbersome and error-prone than
# encoding individual outputs:
try:
_encoding = sys.stdout.encoding or sys.getdefaultencoding()
except:
_encoding = "UTF-8"
import codecs
sys.stdout = codecs.getwriter(_encoding)(sys.stdout.detach(),
'backslashreplace')
sys.stderr = codecs.getwriter(_encoding)(sys.stderr.detach(),
'backslashreplace')
argpars.print_help() argpars.print_help()
argpars.print_usage() argpars.print_usage()
from .cli.grampscli import startcli from .cli.grampscli import startcli

View File

@ -126,7 +126,7 @@ class GrampsXmlWriter(UpdateCallback):
""" """
if filename == '-': if filename == '-':
import sys import sys
g = sys.stdout g = sys.stdout.buffer
self.compress = False self.compress = False
else: else:
base = os.path.dirname(filename) base = os.path.dirname(filename)