Django runserver - ValueError: source code string cannot contain null bytes

I'm trying to run my Django application, which used to work fine before. Now, it is showing this strange error, which seems like coming from Django.

Django Version: 4.1

Python Version: 3.10.6 (Docker Image python:3.10.6)

 django shell commands
 Traceback (most recent call last):
   File "/srv/project/./manage.py", line 9, in <module>
     from django.core.management import execute_from_command_line
   File "/usr/local/lib/python3.10/site-packages/django/core/management/__init__.py", line 16, in <module>
     from django.apps import apps
   File "/usr/local/lib/python3.10/site-packages/django/apps/__init__.py", line 1, in <module>

   File "/usr/local/lib/python3.10/site-packages/django/apps/config.py", line 13, in <module>
   File "/usr/local/lib/python3.10/site-packages/django/apps/config.py", line 62, in AppConfig
   File "/usr/local/lib/python3.10/site-packages/django/utils/functional.py", line 27, in __init__
     from django.utils.deprecation import RemovedInDjango50Warning
   File "/usr/local/lib/python3.10/site-packages/django/utils/deprecation.py", line 5, in <module>
     from asgiref.sync import sync_to_async
 ValueError: source code string cannot contain null bytes
Back to Top