vgrem / Office365-REST-Python-Client

Microsoft 365 & Microsoft Graph Library for Python
MIT License
1.24k stars 325 forks source link

Microsoft.SharePoint.SPFileLockException exception #697

Open jbatra-umeey opened 1 year ago

jbatra-umeey commented 1 year ago

I am trying to upload an Excel file that is ready open in the SharePoint browser. Is there any way I can bypass this shared lock and do a force update to the file

Stack-trace

File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/office365/runtime/client_request.py", line 62, in execute_query raise ClientRequestException(*e.args, response=e.response) office365.runtime.client_request_exception.ClientRequestException: ('-2147018894, Microsoft.SharePoint.SPFileLockException', 'The file https://tenant.sharepoint.com/sites/PsX-India/Shared Documents/XCUITest-Automation/PSX-Xcuitest.xlsx is locked for shared use by xxx [membership].', "423 Client Error: Locked for url: https://tenant.sharepoint.com/sites/PsX-India/_api/Web/getFolderByServerRelativeUrl('%2Fsites%2FPsX-India%2FShared%20Documents%2FXCUITest-Automation%2F')/Files/add(overwrite=true,url='PSX-Xcuitest.xlsx')")

RayenSO commented 10 months ago

Has anyone found a way to handle this problem?

zhixuanyeap commented 10 months ago

Anyone know the solution for this problem?