Message299829
| Author |
psimons |
| Recipients |
Erik.Tollerud, amaury.forgeotdarc, eric.araujo, eric.snow, meador.inge, psimons, python-dev |
| Date |
2017年08月07日.07:57:52 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1502092672.84.0.537529689406.issue13487@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
list(sys.modules.items()) still raises RuntimeError: dictionary changed size during iteration when another thread imports a module.
I would assume dict.copy() is thread-safe so a working fix could use sys.modules.copy().items()
I hit this bug when printing the name of the caller function using
inspect.stack(). The workaround in this case is calling inspect.stack(context=0). |
|