-
-
Notifications
You must be signed in to change notification settings - Fork 111
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
test_recreate failing on Windows Python 3.11 #503
Comments
Passes on Windows with other Python versions for some reason. |
This is the failing test: sqlite-utils/tests/test_recreate.py Lines 21 to 32 in 7b2d1c0
I'm going to try a different way of creating the temporary file: https://docs.pytest.org/en/7.1.x/how-to/tmp_path.html |
Failed again, but just noticed this: https://github.com/simonw/sqlite-utils/actions/runs/3323932266/jobs/5494890223
|
Now
|
I'm not hugely happy with my fix there: sqlite-utils/sqlite_utils/db.py Lines 321 to 328 in c5d7ec1
The problem here was that in the case where the So now I catch the |
This test reliably fails on Windows with Python 3.11. I'm going to skip the test for the moment to get back to green CI... but I'll leave this issue open. This is definitely concerning, I just don't have the right local environment to solve this at the moment. |
... or maybe Windows doesn't like attempts to remove a file that the process has opened? |
Used >>> import psutil
>>> import sqlite3
>>> for f in psutil.Process().open_files(): print(f)
...
>>> sqlite3.connect("/tmp/blah.db")
<sqlite3.Connection object at 0x1007264d0>
>>> conn = _
>>> for f in psutil.Process().open_files(): print(f)
...
popenfile(path='/private/tmp/blah.db', fd=3)
>>> conn.close()
>>> for f in psutil.Process().open_files(): print(f)
...
>>> |
That fixed it. |
TIL about this: https://til.simonwillison.net/python/os-remove-windows |
https://github.com/simonw/sqlite-utils/actions/runs/3323672128/jobs/5494726927
Related:
The text was updated successfully, but these errors were encountered: