对不起我的英语。我将 pyDryve 用于谷歌驱动器 api。我想将文件从一个文件夹移动到另一个文件夹,用于这个多线程。
pool = ThreadPoolExecutor(max_workers=2)
# i have list of file
for file in date_val:
pool.submit(self.start_rename_move_process, file)
def start_rename_move_process(self, file):
try:
print(file['title'])
# Retrieve the existing parents to remove
move_file = thread_drive.g_drive.auth.service.files().get(fileId=file['id'],
fields='parents').execute()
previous_parents = ",".join([parent["id"] for parent in move_file.get('parents')])
# Move the file to the new folder
thread_drive.g_drive.auth.service.files().update(fileId=file['id'],
addParents=MOVE_FOLDER_ID,
removeParents=previous_parents,
fields='id, parents').execute()
except BaseException as e:
print(e)
我有错误:
[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:2217)
我的问题:为什么在一个线程中一切正常,但如果我做 2 个线程我有错误
[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:2217)