You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello.
First of all, thank you for the effort that you put into this library. Is is very usefull for me and many other users.
Current situation:
Since a few weeks ago I am encountering a failure which leads to this library.
I am trying to search or download automatically some files from SharePoint (Excel files, if it matters).
My code has a retry in case of sharepoint failure, meaning that it will redo the python object, with a fresh connection and then retry to download again. This procedure is redone 3 times. If download still fails, then it will abandon the download process.
Problem:
Sometimes the search/download fails, even after 3 retry attempts. The behaviour is seen random, with no specific conditions. If I give it a retry a few hours later, everything works fine.
Please have a look over the trace that I get from Office365 library:
For debug details I can also offer the code used in this case (for search):
defsearch_file(self, file_name: str, mandatory_path: Optional[str] =None) ->Optional[str]:
""" Method searches a file matching the given name and downloads it to local folder. If more than one file are found with the same file name, then only the first will be chosen. Parameters ---------- file_name: str Full name of the file to search, extension (.txt, .xlsx) included. Ex: "TDB_ATRT_EBT-VOLVO-QC3_MKC1_EBT_Safes.xlsx" mandatory_path: str, default="" Extra mandatory path within SharePoint that the found file has to be in. Ex: "SRSx_TestData/SRSx-GEN/MLDB". Say that there two files with same name "MLDB.xlsx" in two different folders: "/Team1/MLDB.xlsx" "/Team2/MLDB.xlsx" If you need the file from 'Team2' folder, you can specify 'mandatory_path="Team2"' Returns ------- None or str None if no file has been found, otherwise a string containing the local relative URL to the found file. Examples -------- >>> conn = SharepointConnection("user@contiwan.com", "pass") >>> conn.search_file("TDB_ATRT_EBT-VOLVO-QC1_MKC1_GENERIC_milestone_Valentina.xlsx", "EBT-VOLVO-QC1") "VEDVerification/SRSx_TestData/EBT-VOLVO-QC1/TDB/TDB_ATRT_EBT-VOLVO-QC1_MKC1_GENERIC_milestone_Valentina.xlsx" """logger.debug(f"Default mandatory relative path: {self.mandatory_rel_path}")
logger.debug(f"Custom mandatory path: {mandatory_path}")
substrings_to_check= [self.mandatory_rel_path, file_name]
ifmandatory_pathisnotNone:
substrings_to_check.append(mandatory_path)
# search partresult=self.context.search.post_query(query_text=f"FileName:'{file_name}'").execute_query()
forrowinresult.value.PrimaryQueryResult.RelevantResults.Table.Rows:
file_url=str(row.Cells["Path"])
ifnotany(sub_strinfile_urlforsub_strinsubstrings_to_check):
continuelogger.debug(f"Found '{file_url}'")
breakelse:
logger.error(f"No file was found with name {file_name}")
returnNonereturnself.mandatory_rel_path+file_url.split(self.mandatory_rel_path)[1]
The text was updated successfully, but these errors were encountered:
Intro:
Hello.
First of all, thank you for the effort that you put into this library. Is is very usefull for me and many other users.
Current situation:
Since a few weeks ago I am encountering a failure which leads to this library.
I am trying to search or download automatically some files from SharePoint (Excel files, if it matters).
My code has a retry in case of sharepoint failure, meaning that it will redo the python object, with a fresh connection and then retry to download again. This procedure is redone 3 times. If download still fails, then it will abandon the download process.
Problem:
Sometimes the search/download fails, even after 3 retry attempts. The behaviour is seen random, with no specific conditions. If I give it a retry a few hours later, everything works fine.
Please have a look over the trace that I get from Office365 library:
For debug details I can also offer the code used in this case (for search):
The text was updated successfully, but these errors were encountered: