python / importlib_metadata

Library to access metadata for Python packages
https://importlib-metadata.readthedocs.io
Apache License 2.0
128 stars 82 forks source link

TypeError: unhashable type: 'types. SimpleNamespace' #506

Closed Dolise closed 2 months ago

Dolise commented 2 months ago

Hey! Today I faced an issue with django autoreload when I rebuild my project. After an hours of trying to fix that I checked list of my packages and noticed that this one was updated yesterday. After downgrade an issue had gone. I'm not sure about reasons, but inform you 'bout that

2024-09-12 13 21 00

pjpetersik commented 2 months ago

I also ran into this error today morning. On Stackoverflow you can find a good analysis of the problem: https://stackoverflow.com/a/78977785/10030883

In short, it is related to the monkey-patching of to sys.modules in the zipp package here: https://github.com/jaraco/zipp/blob/d66007a66b7dbd88e69eaf59faae8b614cba256d/zipp/compat/overlay.py#L23

@jaraco Do you have a recommendation how to deal with this problem?

jaraco commented 2 months ago

Oh, probably the best thing to do is make sure the item that's added to sys.modules is hashable. I'll need to do that in the zipp project.

jaraco commented 2 months ago

The issue should be fixed with zipp 3.20.2, releasing now.