Antoine Pitrou <pit...@free.fr> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32089>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to