This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients ncoghlan, pitrou, serhiy.storchaka, vstinner
Date 2017-11-21.13:50:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In-reply-to <>
Le 21/11/2017 à 14:46, STINNER Victor a écrit :
> I don't know the rationale of the "always" action rather than "default".

Neither do I.  But I don't think it matters a lot.  pydebug builds are
almost only used by Python core developers.  "developer mode" is target
at every Python developer.

> The problem of ResourceWarning is that the warning logs where the last reference to the resource was cleared, or where the a garbage collection was triggered. Multiple resources can be created from different places, but all "die" at the same place.

If they have different names, they will be logged separately.

>>> def f(fname):
...     open(fname)
>>> f('')
__main__:2: ResourceWarning: unclosed file <_io.TextIOWrapper
name='' mode='r' encoding='UTF-8'>
>>> f('')
>>> f('LICENSE.txt')
__main__:2: ResourceWarning: unclosed file <_io.TextIOWrapper
name='LICENSE.txt' mode='r' encoding='UTF-8'>
>>> f('LICENSE.txt')

> For ResourceWarning, your rationale only concerns pydebug build, no?

Why?  I'm talking about "-X dev", not pydebug builds.
Date User Action Args
2017-11-21 13:50:47pitrousetrecipients: + pitrou, ncoghlan, vstinner, serhiy.storchaka
2017-11-21 13:50:47pitroulinkissue32089 messages
2017-11-21 13:50:46pitroucreate