You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My setup is Django 4.0, Python 3.8.10
I came across this issue while working with django-jenkins:
Traceback (most recent call last):
File "manage.py", line 22, in <module>
main()
File "manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "C:\git\django-mssql\venv\lib\site-packages\django\core\management\__init__.py", line 425, in execute_from_command_line
utility.execute()
File "C:\git\django-mssql\venv\lib\site-packages\django\core\management\__init__.py", line 419, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\git\django-mssql\venv\lib\site-packages\django\core\management\__init__.py", line 263, in fetch_command
klass = load_command_class(app_name, subcommand)
File "C:\git\django-mssql\venv\lib\site-packages\django\core\management\__init__.py", line 39, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "C:\Users\AppData\Local\Programs\Python\Python38\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\git\django-mssql\venv\lib\site-packages\django_jenkins\management\commands\jenkins.py", line 10, in <module>
from django_jenkins.runner import CITestSuiteRunner
File "C:\git\django-mssql\venv\lib\site-packages\django_jenkins\runner.py", line 9, in <module>
from django.utils.encoding import smart_text
ImportError: cannot import name 'smart_text' from 'django.utils.encoding' (C:\git\django-mssql\venv\lib\site-packages\django\utils\encoding.py)
Upon doing some digging, it turns out that from django.utils.encoding has been rewritten a little. The only methods with "smart" in them are smart_str and smart_bytes. Thus, the solution is to change all occurences of smart_text to smart_str in runner.py
I just wanted to share this here in case anyone else came across this problem.
The text was updated successfully, but these errors were encountered:
My setup is Django 4.0, Python 3.8.10
I came across this issue while working with django-jenkins:
Upon doing some digging, it turns out that from django.utils.encoding has been rewritten a little. The only methods with "smart" in them are smart_str and smart_bytes. Thus, the solution is to change all occurences of
smart_text
tosmart_str
in runner.pyI just wanted to share this here in case anyone else came across this problem.
The text was updated successfully, but these errors were encountered: