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
When running tests on Windows, I encounter PermissionError and FileNotFoundError related to AiiDA's configuration file. This happens during the _atomic_write operation in aiida.manage.configuration.config.
Steps to reproduce
Set up a Python environment on Windows.
Install AiiDA and its dependencies.
Run tests using pytest tests/test_tasks.py -v.
Observe the following errors:
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process
FileNotFoundError: [Errno 2] No such file or directory
Expected behavior
Tests should run without file permission errors.
Actual Behavior
Tests fail with PermissionError and FileNotFoundError.
Environment
Operating System: Windows 10/11
Python Version: 3.12.0
AiiDA Version: 2.x.x
pytest Version: 7.4.4
Additional context
The issue occurs specifically on Windows due to file locking behavior.
Temporarily disabling antivirus or running as Administrator resolves the issue, but this is not a permanent fix.
A workaround is to patch the _atomic_write method, but this should be addressed in the core library.
Proposed Solution
Consider using a different file-writing strategy for Windows, such as os.replace instead of os.rename, or adding retry logic for file operations.
The text was updated successfully, but these errors were encountered:
Thanks @SatyajitRedekar for sharing the issue you are experiencing.
Consider using a different file-writing strategy for Windows, such as os.replace instead of os.rename, or adding retry logic for file operations.
As far as I know we don't support Windows, officially.
However, usually Windows fans open PRs to make AiiDA compatible with it. see here for example: #6715
If it doesn't go in opposite direction of our development, we usually accept and merge.
If you already have a solution you may open a PR on it so that we could have a look and review it.
P.S. I'm removing bug label, and replace with feature requests.
Describe the bug
When running tests on Windows, I encounter PermissionError and FileNotFoundError related to AiiDA's configuration file. This happens during the _atomic_write operation in aiida.manage.configuration.config.
Steps to reproduce
Set up a Python environment on Windows.
Install AiiDA and its dependencies.
Run tests using pytest tests/test_tasks.py -v.
Observe the following errors:
Expected behavior
Tests should run without file permission errors.
Actual Behavior
Tests fail with PermissionError and FileNotFoundError.
Environment
Operating System: Windows 10/11
Python Version: 3.12.0
AiiDA Version: 2.x.x
pytest Version: 7.4.4
Additional context
The issue occurs specifically on Windows due to file locking behavior.
Temporarily disabling antivirus or running as Administrator resolves the issue, but this is not a permanent fix.
A workaround is to patch the _atomic_write method, but this should be addressed in the core library.
Proposed Solution
Consider using a different file-writing strategy for Windows, such as os.replace instead of os.rename, or adding retry logic for file operations.
The text was updated successfully, but these errors were encountered: