处理文件名中不支持的(?)字符

时间:2015-02-11 13:37:24

标签: python-2.7 shutil

这是错误:

>>>File found: E:\Other\xristopoulos-laptop\PHOTO\quotes\????? t?t??.png

Traceback (most recent call last):
  File "C:\Users\Zarkopafilis\Desktop\fileExtractor.py", line 39, in <module>
shutil.copy2(x , target)
  File "C:\Python27\lib\shutil.py", line 130, in copy2
copyfile(src, dst)
 File "C:\Python27\lib\shutil.py", line 82, in copyfile
with open(src, 'rb') as fsrc:
IOError: [Errno 22] invalid mode ('rb') or filename: 'E:\\Other\\xristopoulos-laptop\\PHOTO\\quotes\\????? t?t??.png'

我正在使用shutil.copy2(src,dest)将一些文件从一个目录复制到另一个目录。我如何面对这些错误?不受支持的字符是希腊语

0 个答案:

没有答案