• Nathaniel J. Smith's avatar
    bpo-32591: fix abort in _PyErr_WarnUnawaitedCoroutine during shutdown (#5337) · dba976b8
    Nathaniel J. Smith yazdı
    When an unawaited coroutine is collected very late in shutdown --
    like, during the final GC at the end of PyImport_Cleanup -- then it
    was triggering an interpreter abort, because we'd try to look up the
    "warnings" module and not only was it missing (we were prepared for
    that), but the entire module system was missing (which we were not
    prepared for).
    
    I've tried to fix this at the source, by making the utility function
    get_warnings_attr robust against this in general. Note that it already
    has the convention that it can return NULL without setting an error,
    which is how it signals that the attribute it was asked to fetch is
    missing, and that all callers already check for NULL returns.
    
    There's a similar check for being late in shutdown at the top of
    warn_explicit, which might be unnecessary after this fix, but I'm not
    sure so I'm going to leave it.
    dba976b8
Adı
Son kayıt (commit)
Son güncelleme
.github Loading commit data...
Doc Loading commit data...
Grammar Loading commit data...
Include Loading commit data...
Lib Loading commit data...
Mac Loading commit data...
Misc Loading commit data...
Modules Loading commit data...
Objects Loading commit data...
PC Loading commit data...
PCbuild Loading commit data...
Parser Loading commit data...
Programs Loading commit data...
Python Loading commit data...
Tools Loading commit data...
m4 Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.hgeol Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
.travis.yml Loading commit data...
LICENSE Loading commit data...
Makefile.pre.in Loading commit data...
README.rst Loading commit data...
aclocal.m4 Loading commit data...
config.guess Loading commit data...
config.sub Loading commit data...
configure Loading commit data...
configure.ac Loading commit data...
install-sh Loading commit data...
pyconfig.h.in Loading commit data...
setup.py Loading commit data...