Извините за мои английские. Я использую pyDryve для Google Drive 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)