X Tutup
The Wayback Machine - https://web.archive.org/web/20220929142929/https://github.com/python/cpython/issues/97641
Skip to content
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

Potential regression in Python 3.11 (multiprocess shutdown?) #97641

Open
carltongibson opened this issue Sep 29, 2022 · 1 comment
Open

Potential regression in Python 3.11 (multiprocess shutdown?) #97641

carltongibson opened this issue Sep 29, 2022 · 1 comment
Labels
3.11 expert-sqlite3 type-bug An unexpected behavior, bug, or error

Comments

@carltongibson
Copy link

carltongibson commented Sep 29, 2022

Running the Django test suite against the Python 3.11 pre-releases, we have hit
a potential regression.

Steps to reproduce

git clone https://github.com/django/django.git
python3.11 -m venv env
.\env\Scripts\Activate.ps1
python -m pip install -e django
cd django\tests
python runtests.py --parallel

Bug report

On Python 3.8, 3.9, and 3.10 this runs without problem.

On Python 3.11 the following error in seen after the test suite completes,
during shutdown:

Traceback (most recent call last):
  File "C:\Users\carlt\src\django\tests\runtests.py", line 773, in <module>
    failures = django_tests(
               ^^^^^^^^^^^^^
  File "C:\Users\carlt\src\django\tests\runtests.py", line 432, in django_tests
    failures = test_runner.run_tests(test_labels)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\carlt\src\django\django\test\runner.py", line 1057, in run_tests
    self.teardown_databases(old_config)
  File "C:\Users\carlt\src\django\django\test\runner.py", line 980, in teardown_databases
    _teardown_databases(
  File "C:\Users\carlt\src\django\django\test\utils.py", line 378, in teardown_databases
    connection.creation.destroy_test_db(
  File "C:\Users\carlt\src\django\django\db\backends\base\creation.py", line 307, in destroy_test_db
    self._destroy_test_db(test_database_name, verbosity)
  File "C:\Users\carlt\src\django\django\db\backends\sqlite3\creation.py", line 111, in _destroy_test_db
    os.remove(test_database_name)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'other_1.sqlite3'

This looked similar to us to open issue #95027 but we were asked to report it
separately.

I've tested all the way back to a1 where (along with other issues now resolved)
this error still occurs:

(django-py311) PS C:\Users\carlt\src\django\tests> python --version
Python 3.11.0rc2
...
(django-py311) PS C:\Users\carlt\src\django\tests> python --version
Python 3.11.0a1

This is somewhat frustrating as we've tried to test on all platforms since the
first releases.
Our test suite would only run on Windows with Python 3.11 very recently as
there was a third-party dependency that was not compatible with Windows. We
will try to adjust to test without dependencies as well on Windows for future
versions. (Sorry about that.)

Please do let us know if we can provide further info. I imagine though the
easiest thing is for you to run this yourself.

Thanks.

//cc @felixxm

Your environment

  • CPython versions tested on: 3.11 pre-releases from a1 to rc2.
  • Operating system and architecture: Windows 11.
@carltongibson carltongibson added the type-bug An unexpected behavior, bug, or error label Sep 29, 2022
@sobolevn
Copy link
Member

sobolevn commented Sep 29, 2022

Based on C:\Users\carlt\src\django\django\db\backends\sqlite3\creation.py I think it might be sqlite related 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.11 expert-sqlite3 type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants
X Tutup