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
This commit is contained in:
Josip 2014-04-07 00:16:28 +02:00
parent a890ff5634
commit 930a2f9819
2 changed files with 3 additions and 2 deletions

View File

@ -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()

View File

@ -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: