-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The temporary file is not accessible and is not being deleted #59
Comments
Hmm, that’s going to be tricky. Am I understanding correctly that this only affects clean-up and the actual integrations and so on work fine? |
That's correct. The program runs, allows me to save and plot data, then exits with the error right at the end. |
Not a solution, but a workaround in the meantime might be changing the location of the tempfiles? I have to do this when I run a bunch of systems in parallel because of some issues with the server where I run them: # import warnings
import os
import tempfile
# TEMP DIR
tempdir = tempfile.TemporaryDirectory(dir=Path(__file__).parent, prefix='jitcdde_tmp_')
tempfile.tempdir = tempdir.name
os.environ['TMPDIR'] = tempdir.name |
I wouldn't mind this work around at all but I gave it a go and still getting the same errors as before. I switched out |
Sorry that this took so long. I have not tried to reproduce this problem on account of the hassle of preparing a suitable Windows machine. However, I looked into the respective code, which suggests the following:
I tried to address this by using If it doesn’t, one thing to try is to call JiTCDDE’s destructor explicitly at the end of your program or when you don’t need the instance anymore and wrap that in a try:
del DDE # alternatively: DDE.__del__()
except PermissionError:
pass |
I am using the jitcdde module in a fairly large system of ODE's and getting the following errors when running my code: "PermissionError: [WinError 5] Access is denied: ". I ran the jitcdde.test() and got the same error. I installed jitcdde using
pip install jitcdde
. I have run the MCVE in an administrator cmd and powershell. I have also tried in an anaconda environment. I can still run integrations, plot, and save the results but it leaves the temporary file behind and closes with the same WinError 5. Here is the MCVE:The output is:
The python version is 3.12.1
The jitcdde version is 1.8.1
I have also used jitcdde before on another computer and had no problems at all. I guess I have likely installed something wrong or am not running as an administrator somehow but I have no idea how to fix the issue since the exact same code is working fine on another laptop where the only obvious difference is that it is running python 3.10.4.
Thank you for any help!
The text was updated successfully, but these errors were encountered: