Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#30921 closed Bug (duplicate)

_DeadlockError is raised when using StatReloader.

Reported by: Man Python Owned by: nobody
Component: Utilities Version: 2.2
Severity: Normal Keywords: makemigrations migrate WindowsError
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


There is many issues around this type error:
WindowsError: [Error 123] The filename, directory name, or volume label syntax is incorrect: '<frozen importlib._bootstrap>'

Most of issues don't have any solutions and are not solved and no any sense sugestions.

What I discover..

This is happen when we often doing makemigrations and migrate with variable way as
makemigrations myapp and migrate
makemigrations myapp and migrate myapp
makemigrations and migrate myapp
makemigrations and migrate

The change db from sqlite to mysql and in diffrent way made this same bug.
Some times python -mpip install --force-reinstall -I django solved error, in other situations not.. don't know why and what is relation in this, but reading sugestions 2 times this helped me, and in next progress of project not.

The cmd python runserver doing this error, but e.q. this same cmd via Visual Studio Code not return this errors
Adding parameter python runserver --nothreading still this same error but python runserver --noreload ommiting error in case that working with this mode in dev is not comfy.
Coz VSC has some bug in debug around static then must fighting with this all. Django made me sad :(

Change History (4)

comment:1 by Man Python, 5 years ago

Example of log

python runserver
Watching for file changes with StatReloader
Performing system checks...

Exception in thread django-main-thread:
Traceback (most recent call last):
  File "E:\Python36\lib\site-packages\django\template\", line 66, in __getitem__
    return self._engines[alias]
KeyError: 'django'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:\Python36\lib\", line 916, in _bootstrap_inner
  File "E:\Python36\lib\", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "E:\Python36\lib\site-packages\django\utils\", line 54, in wrapper
    fn(*args, **kwargs)
  File "E:\Python36\lib\site-packages\django\core\management\commands\", line 117, in inner_run
  File "E:\Python36\lib\site-packages\django\core\management\", line 390, in check
  File "E:\Python36\lib\site-packages\django\core\management\", line 377, in _run_checks
    return checks.run_checks(**kwargs)
  File "E:\Python36\lib\site-packages\django\core\checks\", line 72, in run_checks
    new_errors = check(app_configs=app_configs)
  File "E:\Python36\lib\site-packages\django\contrib\admin\", line 79, in check_dependencies
    for engine in engines.all():
  File "E:\Python36\lib\site-packages\django\template\", line 90, in all
    return [self[alias] for alias in self]
  File "E:\Python36\lib\site-packages\django\template\", line 90, in <listcomp>
    return [self[alias] for alias in self]
  File "E:\Python36\lib\site-packages\django\template\", line 81, in __getitem__
    engine = engine_cls(params)
  File "E:\Python36\lib\site-packages\django\template\backends\", line 25, in __init__
    options['libraries'] = self.get_templatetag_libraries(libraries)
  File "E:\Python36\lib\site-packages\django\template\backends\", line 43, in get_templatetag_libraries
    libraries = get_installed_libraries()
  File "E:\Python36\lib\site-packages\django\template\backends\", line 108, in get_installed_libraries
    for name in get_package_libraries(pkg):
  File "E:\Python36\lib\site-packages\django\template\backends\", line 121, in get_package_libraries
    module = import_module(entry[1])
  File "E:\Python36\lib\importlib\", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "E:\Python36\lib\site-packages\rest_framework\templatetags\", line 12, in <module>
    from rest_framework.renderers import HTMLFormRenderer
  File "E:\Python36\lib\site-packages\rest_framework\", line 19, in <module>
    from django.test.client import encode_multipart
  File "E:\Python36\lib\site-packages\django\test\", line 23, in <module>
    from django.test import signals
  File "<frozen importlib._bootstrap>", line 968, in _find_and_load
  File "<frozen importlib._bootstrap>", line 149, in __enter__
  File "<frozen importlib._bootstrap>", line 94, in acquire
_frozen_importlib._DeadlockError: deadlock detected by _ModuleLock('django.test.signals') at 92522872

Traceback (most recent call last):
  File "", line 21, in <module>
  File "", line 17, in main
  File "E:\Python36\lib\site-packages\django\core\management\", line 381, in execute_from_command_line
  File "E:\Python36\lib\site-packages\django\core\management\", line 375, in execute
  File "E:\Python36\lib\site-packages\django\core\management\", line 323, in run_from_argv
    self.execute(*args, **cmd_options)
  File "E:\Python36\lib\site-packages\django\core\management\commands\", line 60, in execute
    super().execute(*args, **options)
  File "E:\Python36\lib\site-packages\django\core\management\", line 364, in execute
    output = self.handle(*args, **options)
  File "E:\Python36\lib\site-packages\django\core\management\commands\", line 95, in handle**options)
  File "E:\Python36\lib\site-packages\django\core\management\commands\", line 102, in run
    autoreload.run_with_reloader(self.inner_run, **options)
  File "E:\Python36\lib\site-packages\django\utils\", line 598, in run_with_reloader
    start_django(reloader, main_func, *args, **kwargs)
  File "E:\Python36\lib\site-packages\django\utils\", line 583, in start_django
  File "E:\Python36\lib\site-packages\django\utils\", line 301, in run
  File "E:\Python36\lib\site-packages\django\utils\", line 307, in run_loop
  File "E:\Python36\lib\site-packages\django\utils\", line 347, in tick
    for filepath, mtime in self.snapshot_files():
  File "E:\Python36\lib\site-packages\django\utils\", line 363, in snapshot_files
    for file in self.watched_files():
  File "E:\Python36\lib\site-packages\django\utils\", line 262, in watched_files
    yield from iter_all_python_module_files()
  File "E:\Python36\lib\site-packages\django\utils\", line 103, in iter_all_python_module_files
    return iter_modules_and_files(modules, frozenset(_error_files))
  File "E:\Python36\lib\site-packages\django\utils\", line 139, in iter_modules_and_files
    if not path.exists():
  File "E:\Python36\lib\", line 1336, in exists
  File "E:\Python36\lib\", line 1158, in stat
    return self._accessor.stat(self)
  File "E:\Python36\lib\", line 387, in wrapped
    return strfunc(str(pathobj), *args)
OSError: [WinError 123] Nazwa pliku, nazwa katalogu lub składnia etykiety woluminu jest niepoprawna: '<frozen importlib._bootstrap>'

comment:2 by Mariusz Felisiak, 5 years ago

Component: MigrationsUtilities
Resolution: duplicate
Status: newclosed
Summary: WindowsError: [Error 123] The filename, directory name, or volume label syntax is incorrect: '<frozen importlib._bootstrap>'WindowsError: [Error 123] The filename, directory name, or volume label syntax is incorrect.

Duplicate of #30352.

comment:3 by Mariusz Felisiak, 5 years ago

Summary: WindowsError: [Error 123] The filename, directory name, or volume label syntax is incorrect._DeadlockError is raised when using StatReloader.

comment:4 by Man Python, 5 years ago

I deleted all _pycache_ dirs with files .pyc and first time runserver was ok, after ctr+c and next try the error back.

Note: See TracTickets for help on using tickets.
Back to Top