[minor] change filename to unicode after os.walk and os.listdir
This commit is contained in:
parent
49e71400ac
commit
b6177cbb5b
@ -96,6 +96,7 @@ def backup_to_dropbox():
|
||||
error_log = []
|
||||
path = os.path.join(get_base_path(), "public", "files")
|
||||
for filename in os.listdir(path):
|
||||
filename = cstr(filename)
|
||||
if filename in ignore_list:
|
||||
continue
|
||||
|
||||
|
@ -85,6 +85,7 @@ def backup_to_gdrive():
|
||||
webnotes.conn.close()
|
||||
path = os.path.join(get_base_path(), "public", "files")
|
||||
for filename in os.listdir(path):
|
||||
filename = cstr(filename)
|
||||
found = False
|
||||
filepath = os.path.join(path, filename)
|
||||
ext = filename.split('.')[-1]
|
||||
|
@ -9,6 +9,7 @@ from __future__ import unicode_literals
|
||||
import os, json
|
||||
from xml.etree import ElementTree as ET
|
||||
from webnotes.utils.datautils import read_csv_content
|
||||
from webnotes.utils import cstr
|
||||
|
||||
path = "/Users/rmehta/Downloads/openerp/openerp/addons"
|
||||
chart_roots = []
|
||||
@ -108,6 +109,7 @@ def find_charts():
|
||||
basename = os.path.basename(basepath)
|
||||
if basename.startswith("l10n"):
|
||||
for fname in files:
|
||||
fname = cstr(fname)
|
||||
filepath = os.path.join(basepath, fname)
|
||||
if fname.endswith(".xml"):
|
||||
tree = ET.parse(filepath)
|
||||
|
Loading…
x
Reference in New Issue
Block a user