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

'Wrapper has not been Initialized' error on import in Py3.12 with django 5 #2954

Open
amcsparron2793-Water opened this issue Apr 19, 2024 · 0 comments

Comments

@amcsparron2793-Water
Copy link

PyGithub works great on my project with Django 4.3/Python3.8 - but while testing to upgrade to Django 5/Py3.12, I found that on import, (specifically, from github import Github, Repository, BadCredentialsException, GithubException, UnknownObjectException)
a Value Error gets thrown, see below.
it seems to be something to do with wrapt, but I've tried installing wrapt on its own, as per a previous issue, but that didn't seem to help as it was the same version.

Exception in thread django-main-thread: Traceback (most recent call last): File "C:\Users\amcsparron\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 1073, in _bootstrap_inner self.run() File "C:\Users\amcsparron\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 1010, in run self._target(*self._args, **self._kwargs) File "C:\Users\amcsparron\Desktop\Python_Projects\BackflowPreventionValveCatalog\venv312\Lib\site-packages\django\utils\autoreload.py", line 64, in wrapper fn(*args, **kwargs) File "C:\Users\amcsparron\Desktop\Python_Projects\BackflowPreventionValveCatalog\venv312\Lib\site-packages\django\core\management\commands\runserver.py", line 133, in inner_run self.check(display_num_errors=True) File "C:\Users\amcsparron\Desktop\Python_Projects\BackflowPreventionValveCatalog\venv312\Lib\site-packages\django\core\management\base.py", line 486, in check all_issues = checks.run_checks( ^^^^^^^^^^^^^^^^^^ File "C:\Users\amcsparron\Desktop\Python_Projects\BackflowPreventionValveCatalog\venv312\Lib\site-packages\django\core\checks\registry.py", line 88, in run_checks new_errors = check(app_configs=app_configs, databases=databases) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\amcsparron\Desktop\Python_Projects\BackflowPreventionValveCatalog\venv312\Lib\site-packages\django\core\checks\urls.py", line 42, in check_url_namespaces_unique all_namespaces = _load_all_namespaces(resolver) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\amcsparron\Desktop\Python_Projects\BackflowPreventionValveCatalog\venv312\Lib\site-packages\django\core\checks\urls.py", line 61, in _load_all_namespaces url_patterns = getattr(resolver, "url_patterns", []) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\amcsparron\Desktop\Python_Projects\BackflowPreventionValveCatalog\venv312\Lib\site-packages\django\utils\functional.py", line 47, in __get__ res = instance.__dict__[self.name] = self.func(instance) ^^^^^^^^^^^^^^^^^^^ File "C:\Users\amcsparron\Desktop\Python_Projects\BackflowPreventionValveCatalog\venv312\Lib\site-packages\django\urls\resolvers.py", line 738, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) ^^^^^^^^^^^^^^^^^^^ File "C:\Users\amcsparron\Desktop\Python_Projects\BackflowPreventionValveCatalog\venv312\Lib\site-packages\django\utils\functional.py", line 47, in __get__ res = instance.__dict__[self.name] = self.func(instance) ^^^^^^^^^^^^^^^^^^^ File "C:\Users\amcsparron\Desktop\Python_Projects\BackflowPreventionValveCatalog\venv312\Lib\site-packages\django\urls\resolvers.py", line 731, in urlconf_module return import_module(self.urlconf_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\amcsparron\AppData\Local\Programs\Python\Python312\Lib\importlib\__init__.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen importlib._bootstrap>", line 1387, in _gcd_import File "<frozen importlib._bootstrap>", line 1360, in _find_and_load File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 935, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 995, in exec_module File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed File "C:\Users\amcsparron\Desktop\Python_Projects\BackflowPreventionValveCatalog\BackflowPreventionValveCatalog\urls.py", line 22, in <module> path('', include('Homepage.urls')), ^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\amcsparron\Desktop\Python_Projects\BackflowPreventionValveCatalog\venv312\Lib\site-packages\django\urls\conf.py", line 39, in include urlconf_module = import_module(urlconf_module) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\amcsparron\AppData\Local\Programs\Python\Python312\Lib\importlib\__init__.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen importlib._bootstrap>", line 1387, in _gcd_import File "<frozen importlib._bootstrap>", line 1360, in _find_and_load File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 935, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 995, in exec_module File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed File "C:\Users\amcsparron\Desktop\Python_Projects\BackflowPreventionValveCatalog\Homepage\urls.py", line 3, in <module> from . import views File "C:\Users\amcsparron\Desktop\Python_Projects\BackflowPreventionValveCatalog\Homepage\views.py", line 5, in <module> from .forms import ValveBugReportModelForm File "C:\Users\amcsparron\Desktop\Python_Projects\BackflowPreventionValveCatalog\Homepage\forms.py", line 19, in <module> raise e File "C:\Users\amcsparron\Desktop\Python_Projects\BackflowPreventionValveCatalog\Homepage\forms.py", line 15, in <module> from github import Github, Repository, BadCredentialsException, GithubException, UnknownObjectException File "C:\Users\amcsparron\Desktop\Python_Projects\BackflowPreventionValveCatalog\venv312\Lib\site-packages\github\__init__.py", line 52, in <module> from . import Auth File "C:\Users\amcsparron\Desktop\Python_Projects\BackflowPreventionValveCatalog\venv312\Lib\site-packages\github\Auth.py", line 39, in <module> from github.InstallationAuthorization import InstallationAuthorization File "C:\Users\amcsparron\Desktop\Python_Projects\BackflowPreventionValveCatalog\venv312\Lib\site-packages\github\InstallationAuthorization.py", line 45, in <module> import github.NamedUser File "C:\Users\amcsparron\Desktop\Python_Projects\BackflowPreventionValveCatalog\venv312\Lib\site-packages\github\NamedUser.py", line 60, in <module> import github.Event File "C:\Users\amcsparron\Desktop\Python_Projects\BackflowPreventionValveCatalog\venv312\Lib\site-packages\github\Event.py", line 46, in <module> import github.Organization File "C:\Users\amcsparron\Desktop\Python_Projects\BackflowPreventionValveCatalog\venv312\Lib\site-packages\github\Organization.py", line 91, in <module> import github.OrganizationDependabotAlert File "C:\Users\amcsparron\Desktop\Python_Projects\BackflowPreventionValveCatalog\venv312\Lib\site-packages\github\OrganizationDependabotAlert.py", line 31, in <module> from github.Repository import Repository File "C:\Users\amcsparron\Desktop\Python_Projects\BackflowPreventionValveCatalog\venv312\Lib\site-packages\github\Repository.py", line 164, in <module> import github.Artifact File "C:\Users\amcsparron\Desktop\Python_Projects\BackflowPreventionValveCatalog\venv312\Lib\site-packages\github\Artifact.py", line 49, in <module> import github.WorkflowRun File "C:\Users\amcsparron\Desktop\Python_Projects\BackflowPreventionValveCatalog\venv312\Lib\site-packages\github\WorkflowRun.py", line 39, in <module> import github.PullRequest File "C:\Users\amcsparron\Desktop\Python_Projects\BackflowPreventionValveCatalog\venv312\Lib\site-packages\github\PullRequest.py", line 87, in <module> import github.Team File "C:\Users\amcsparron\Desktop\Python_Projects\BackflowPreventionValveCatalog\venv312\Lib\site-packages\github\Team.py", line 89, in <module> class Team(CompletableGithubObject): File "C:\Users\amcsparron\Desktop\Python_Projects\BackflowPreventionValveCatalog\venv312\Lib\site-packages\github\Team.py", line 260, in Team @deprecated( ^^^^^^^^^^^ File "C:\Users\amcsparron\Desktop\Python_Projects\BackflowPreventionValveCatalog\venv312\Lib\site-packages\deprecated\classic.py", line 276, in deprecated @wrapt.decorator(adapter=adapter) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\amcsparron\Desktop\Python_Projects\BackflowPreventionValveCatalog\venv312\Lib\site-packages\wrapt\decorators.py", line 427, in decorator return _build(wrapper, _wrapper, adapter=decorator) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\amcsparron\Desktop\Python_Projects\BackflowPreventionValveCatalog\venv312\Lib\site-packages\wrapt\decorators.py", line 239, in _build return AdapterWrapper(wrapped=wrapped, wrapper=wrapper, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "_pydevd_bundle\\pydevd_pep_669_tracing_cython.pyx", line 504, in _pydevd_bundle.pydevd_pep_669_tracing_cython.PyRaiseCallback.__call__ File "_pydevd_bundle\\pydevd_pep_669_tracing_cython.pyx", line 47, in _pydevd_bundle.pydevd_pep_669_tracing_cython.PEP669CallbackBase.frame ValueError: wrapper has not been initialized

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant