#35756: Auto reload raises TypeError: unhashable type: 'types.SimpleNamespace'
-------------------------------+--------------------------------------
Reporter: Paul Petersik | Owner: (none)
Type: Bug | Status: closed
Component: Utilities | Version: 5.0
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Sarah Boyce):
* resolution: => duplicate
* status: new => closed
Comment:
I can replicate an error, but as Tim mentioned, I will mark this is a
duplicate of #35085
{{{#!diff
--- a/tests/utils_tests/test_autoreload.py
+++ b/tests/utils_tests/test_autoreload.py
@@ -148,6 +148,12 @@ class TestIterModulesAndFiles(SimpleTestCase):
self.addCleanup(lambda: sys.modules.pop("time_proxy", None))
list(autoreload.iter_all_python_module_files()) # No crash.
+ def test_unhashable_objects_in_sys_module(self):
+ name_space = types.SimpleNamespace()
+ sys.modules["name_space"] = name_space # type:
ignore[assignment]
+ self.addCleanup(lambda: sys.modules.pop("name_space", None))
+ list(autoreload.iter_all_python_module_files()) # Crash
+
def test_module_without_spec(self):
module = types.ModuleType("test_module")
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35756#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/01070191e6379cdd-9e706dd7-60b9-45b2-9f23-381fbd60d2e8-000000%40eu-central-1.amazonses.com.