Os.chdir() gives "[Errno 2] No such file or directory" on my local app

Hello, here are some information:

  1. My app runs locally
  2. The error message is [Errno 2] No such file or directory: ‘C:\Users\user\Documents\Data\20240304\processing_app.py’
  3. My streamlit is version 1.45.1 and python is 3.10.16 (due to the nanoscope package limitation, i can’t have the latest version of python)

Hope I’ll be clear, it’s the 1st time I report a bug. Due to confidentiality, I can’t post my code, so i’ll explain at my best.
Until very recently (mayble 1 to 2 weeks) my streamlit app was working very well. For a little of context, the 1st step of my app allow the user to explore folders (from Simple Folder Explorer), find the folder with the data to process, then the user select a dataset among the available one (st.selectbox() showing only files in the selected folder).
Then, I use the command os.chdir(selected_path) to go in the selected folder, and upload my file (extension is .spm) with the nanoscope package (nanoscope · PyPI).

But I recently started to have this error [Errno 2] No such file or directory: ‘C:\Users\user\Documents\Data\20240304\processing_app.py’ everytime I need to save or load another file (.csv or .txt).
My path of start is C:\Users\user\Documents\Python scripts
And the one I have my data will be C:\Users\user\Documents\Data\20240304\ for example
And processing_app.py is the name of my app

One of my other app works fine, and doesn’t have os.chdir(), so I have tried to add one : the same error appears. So I conclued that os.chdir doesn’t work anymore, question being : why ? Because I never changed those part, I even tried with a version of my app from 3 months ago, the errors appear.
Nanoscope package doesn’t allow path+filename to open the data, I really need to move in the working directory for it to function.
I tried to go in the working directory, extract datas with nanoscope, then go back in the initial folder, but the app is very slow.

My problem is probably similar to this one (Issue with os.chdir() in Version 1.10.0) but it never had answer on it… So i’m lost.

Thanks to those who will read, and I’m open to any suggestion.