之前用Apache commons-vfs工具进行ftp操作(FTP服务器是 FileZilla Server) 上传本地文件 到 ftp服务器上,如果文件名称 包含 中文 报错 org.apache.commons.vfs2.FileSystemException: Could not put FTP file to "e:\红黄蓝股价暴跌.docx" to sftp://dsideal:***@192.168.1.168/红黄蓝股价暴跌.docx 1.有可能是 登录FTP用户名没有
代码: import os path = r"C:\Users\Administrator\Desktop\***" print('filenum:',len([lists for lists in os.listdir(path) if os.path.isfile(os.path.join(path, lists))]))