246
246
filelists_index = 0
248
248
for opt, arg in argtuples:
249
# assert isinstance(opt, unicode), u"option " + util.bytes_to_uc(opt) + u" is not unicode"
250
# assert isinstance(arg, unicode), u"option " + util.bytes_to_uc(arg) + u" is not unicode"
249
assert isinstance(opt, unicode), u"option " + opt.decode(sys.getfilesystemencoding(), "ignore") + \
251
assert isinstance(arg, unicode), u"option " + arg.decode(sys.getfilesystemencoding(), "ignore") + \
251
253
# ToDo: replace the next three lines once we can make commandline return unicode
252
opt = opt.decode(sys.getfilesystemencoding(), "strict")
253
if not isinstance(arg, unicode):
254
# ToDo: use sys.getfilesystemencoding() once figure out why this is not working.
255
arg = arg.decode("UTF-8", "strict") # ToDo: Change from "strict" once found problems
254
# opt = opt.decode(sys.getfilesystemencoding(), "strict")
255
# if not isinstance(arg, unicode):
256
# # ToDo: use sys.getfilesystemencoding() once figure out why this is not working.
257
# arg = arg.decode("UTF-8", "strict") # ToDo: Change from "strict" once found problems
257
259
if opt == u"--exclude":
258
260
self.add_selection_func(self.glob_get_sf(arg, 0))