ValueError:set_wakeup_fd仅在Apache2.4.41 + Python 3.8.1 + Django 3.0.2 + MySQL 8.0.19的主线程中起作用。

问题描述 投票:1回答:1
[当我在Windows 10专业版上使用Apache2.4.41 + Python 3.8.1 + Django 3.0.2 + MySQL 8.0.19运行Django Web应用程序时,它将在/处抛出Value Error。 set_wakeup_fd仅在主线程中有效。

此问题是Python 3.8中的回归结果,已在11月的更高版本的Python中修复。有关更多详细信息-https://bugs.python.org/issue38563

错误的堆栈跟踪如下-

Environment: Request Method: GET Request URL: http://127.0.0.1/ Django Version: 3.0.2 Python Version: 3.8.1 Installed Applications: ['Analysis.apps.AnalysisConfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.humanize'] Installed Middleware: ['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware'] Traceback (most recent call last): File "c:\python38\lib\site-packages\django\core\handlers\exception.py", line 34, in inner response = get_response(request) File "c:\python38\lib\site-packages\django\core\handlers\base.py", line 115, in _get_response response = self.process_exception_by_middleware(e, request) File "c:\python38\lib\site-packages\django\core\handlers\base.py", line 113, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "F:\IndianMarketAnalysis\ISMA\Analysis\views.py", line 8, in home date_list = dict(d.date_list()) File "F:\IndianMarketAnalysis\ISMA\Analysis\models.py", line 7, in date_list with connection.cursor() as cursor: File "c:\python38\lib\site-packages\django\utils\asyncio.py", line 19, in inner event_loop = asyncio.get_event_loop() File "c:\python38\lib\asyncio\events.py", line 636, in get_event_loop self.set_event_loop(self.new_event_loop()) File "c:\python38\lib\asyncio\events.py", line 656, in new_event_loop return self._loop_factory() File "c:\python38\lib\asyncio\windows_events.py", line 310, in __init__ super().__init__(proactor) File "c:\python38\lib\asyncio\proactor_events.py", line 632, in __init__ signal.set_wakeup_fd(self._csock.fileno()) Exception Type: ValueError at / Exception Value: set_wakeup_fd only works in main thread

此外,此应用程序在使用-python manage.py runserver的本地开发环境中也可以很好地工作。

请提出下一步建议。

[当我在Windows 10专业版上使用Apache2.4.41 + Python 3.8.1 + Django 3.0.2 + MySQL 8.0.19运行Django Web应用程序时,它将在/处抛出Value Error。 set_wakeup_fd仅适用于main ...

python django python-3.x apache
1个回答
0
投票
我有完全相同的错误。我打开了issue
© www.soinside.com 2019 - 2024. All rights reserved.