7258: transcode os.path.join args from the fs enc to prevent a crash

Fix 3rd party plugin loading for Py2/Py3 in Windows when sys.path
is in Unicode or/and is not encodable in 'mbcs' encodings
This commit is contained in:
Josip
2014-04-08 22:39:11 +02:00
parent 2155ae381f
commit 7fdf0f9225
3 changed files with 32 additions and 6 deletions

View File

@@ -1307,7 +1307,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
if sys.version_info[0] >= 3:
key= str(key)
else:
key = str(tuple(str(k) for k in key))
key = str(tuple(k.encode('utf-8') for k in key))
if isinstance(key, UNITYPE):
key = key.encode('utf-8')
if not self.readonly: