When I run a script in Windows Task Scheduler, I got
[Errno 22] invalid mode ('wb') or filename:
'\\172.16.60.16\\\xf1\xee\xba\xcf\\lantian\\FAC\\FAC\xbb\xe3\xd7\xdc\xca\xfd\xbe\xdd\xd4\xb4\\F17\xba\xc5\xbb\xfa\xcc\xa8\xd2\xec\xb3\xa3\xbc\xc7\xc2\xbc\xb1\xed.csv
but I run it in IDLE and console was fine. code down there:
record_dir = r"D:\Record"
target_dir = r"\\172.16.60.16\耦合\lantian\FAC\FAC汇总数据源"
file_path = os.path.join(record_dir, filename)
target_path = os.path.join(target_dir, filename)
shutil.copyfile(file_path, target_path)
Is it an encoding problem?
I've tried to convert target_path to unicode, but that doesn't work, either.