# inexpensive since we call os.walk() here anyway).
unicode_errors = []
line_ending_re = re.compile('[\n\r]')
+ srcroot_len = len(srcroot)
+ ed_len = len(self.settings["ED"])
while True:
myfilelist = []
mylinklist = []
paths_with_newlines = []
- srcroot_len = len(srcroot)
def onerror(e):
raise
walk_iter = os.walk(srcroot, onerror=onerror)
encoding=_encodings['merge'], errors='replace')
os.rename(parent, new_parent)
unicode_error = True
- unicode_errors.append(new_parent[srcroot_len:])
+ unicode_errors.append(new_parent[ed_len:])
break
for fname in files:
new_fpath = os.path.join(parent, new_fname)
os.rename(fpath, new_fpath)
unicode_error = True
- unicode_errors.append(new_fpath[srcroot_len:])
+ unicode_errors.append(new_fpath[ed_len:])
fname = new_fname
fpath = new_fpath
else:
_preinst_bsdflags(mysettings)
destdir = mysettings["D"]
+ ed_len = len(mysettings["ED"])
unicode_errors = []
while True:
encoding=_encodings['merge'], errors='replace')
os.rename(parent, new_parent)
unicode_error = True
- unicode_errors.append(new_parent[len(destdir):])
+ unicode_errors.append(new_parent[ed_len:])
break
for fname in chain(dirs, files):
new_fpath = os.path.join(parent, new_fname)
os.rename(fpath, new_fpath)
unicode_error = True
- unicode_errors.append(new_fpath[len(destdir):])
+ unicode_errors.append(new_fpath[ed_len:])
fname = new_fname
fpath = new_fpath
else: