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 <da6d5956-1372-bd59-45b7-dd251c01c4b5@free.fr>
In-reply-to <1511271963.98.0.213398074469.issue32089@psf.upfronthosting.co.za>
Content
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('setup.py')
__main__:2: ResourceWarning: unclosed file <_io.TextIOWrapper
name='setup.py' mode='r' encoding='UTF-8'>
>>> f('setup.py')
>>> 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.
History
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