Fixed some unicode path issues with exporting.
This commit is contained in:
parent
2cc1964200
commit
af56701b4e
2 changed files with 22 additions and 12 deletions
12
utils.py
12
utils.py
|
|
@ -19,7 +19,17 @@ def get_temp_dir():
|
|||
return tempfile.gettempdir()
|
||||
|
||||
def path_join(base, *rest):
|
||||
rpath = u'/'.join(rest)
|
||||
try:
|
||||
base = base.decode('utf-8')
|
||||
except UnicodeEncodeError:
|
||||
base = unicode(base)
|
||||
new_rest = []
|
||||
for i in xrange(len(rest)):
|
||||
try:
|
||||
new_rest.append(rest[i].decode('utf-8'))
|
||||
except UnicodeEncodeError:
|
||||
new_rest.append(unicode(rest[i]))
|
||||
rpath = u'/'.join(new_rest)
|
||||
if os.path.isabs(rpath):
|
||||
return rpath
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue