From 930a2f9819de6c9c4300bd1bf3d52bebd3e472b1 Mon Sep 17 00:00:00 2001 From: Josip Date: Mon, 7 Apr 2014 00:16:28 +0200 Subject: [PATCH] 7258: transcode os.path.join args from the fs enc to prevent a crash :35653 rename family tree with python2 :35653 self.reference_map.delete --- gramps/cli/clidbman.py | 1 + gramps/gen/db/write.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gramps/cli/clidbman.py b/gramps/cli/clidbman.py index 12889815f..cfbde0c47 100644 --- a/gramps/cli/clidbman.py +++ b/gramps/cli/clidbman.py @@ -409,6 +409,7 @@ class CLIDbManager(object): """ try: filepath = conv_to_unicode(filepath, 'utf8') + new_text = conv_to_unicode(new_text, 'utf8') name_file = io.open(filepath, "r", encoding='utf8') old_text=name_file.read() name_file.close() diff --git a/gramps/gen/db/write.py b/gramps/gen/db/write.py index 5fe60bc8b..24001b64b 100644 --- a/gramps/gen/db/write.py +++ b/gramps/gen/db/write.py @@ -1305,9 +1305,9 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback): 'which is partly bytecode, this is not allowed.\n' 'Key is %s') % str(key)) if sys.version_info[0] >= 3: - key= str(tuple(k for k in key)) + key= str(key) else: - key = str(tuple(k.decode('utf-8') for k in key)) + key = str(tuple(str(k) for k in key)) if isinstance(key, UNITYPE): key = key.encode('utf-8') if not self.readonly: