#35756: Auto reload raises TypeError: unhashable type: 'types.SimpleNamespace'
-------------------------------+--------------------------------------
Reporter: Paul Petersik | Type: Bug
Status: new | Component: Utilities
Version: 5.0 | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
The `iter_modules_and_files` function from `django.utils.autoreload`
raises `TypeError: unhashable type: 'types.SimpleNamespace'` when a
`types.SimpleNamespace` is put into `sys.modules`.
This is for instance the case when the `zipp>=3.18.2` package is used (see
[https://github.com/jaraco/zipp/blob/d66007a66b7dbd88e69eaf59faae8b614cba256d/zipp/compat/overlay.py#L23])
which is used by `importlib_meta>=8.5.0` (see
[https://github.com/python/importlib_metadata/blob/90073b1aa7a49cc5fdbdc0e6e871f39e461b9422/pyproject.toml#L21])
The error can be reproduced by putting `from zipp.compat.overlay import
zipfile` somewhere in your django project.
This problem was already discussed and analyzed on stackoverflow:
https://stackoverflow.com/questions/78977665/django-autoreload-raises-
typeerror-unhashable-type-types-simplenamespace/78977785#78977785
--
Ticket URL: <https://code.djangoproject.com/ticket/35756>
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/01070191e608c637-daf98460-c898-4a44-802d-481440844bf7-000000%40eu-central-1.amazonses.com.