'Shareplum : ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host

I'm importing .xlsx file to Sharepoint using Shareplum, i found that when the excel is more then 30MB i get the error ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host i added a sleep but problem persist

This is my code :

    authcookie = Office365(base_path, username=username, password=password).GetCookies()
    full_path = base_path+'/teams/'+site_name
    site = Site(full_path, version=Version.v2016, authcookie=authcookie)
    folder = site.Folder(doc_library)
    file = 'path'
    os.chdir(file)
    time.sleep(5)
    
    with open(file_name, 'rb+') as file_input: 
        time.sleep(5)            
        try: 
            time.sleep(5)
            folder.upload_file(file_input, file_name)
            time.sleep(5)
        except Exception as err:
            print("Some error occurred: " + str(err))



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source