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 vajrasky
Recipients vajrasky
Date 2013-08-06.15:31:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1375803104.23.0.740839065527.issue18670@psf.upfronthosting.co.za>
In-reply-to
Content
[sky@localhost cpython]$ cat /tmp/a.txt
x-application/mimea mimea
application/mimeb mimeb
[sky@localhost cpython]$ cat /tmp/a.py
import warnings
warnings.simplefilter('default')
import mimetypes

mimetypes.read_mime_types('/tmp/a.txt')
[sky@localhost cpython]$ python3 /tmp/a.py
/tmp/a.py:7: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/a.txt' mode='r' encoding='UTF-8'>
  mimetypes.read_mime_types('/tmp/a.txt')



Attached the patch to fix the resource warning problem.
History
Date User Action Args
2013-08-06 15:31:44vajraskysetrecipients: + vajrasky
2013-08-06 15:31:44vajraskysetmessageid: <1375803104.23.0.740839065527.issue18670@psf.upfronthosting.co.za>
2013-08-06 15:31:44vajraskylinkissue18670 messages
2013-08-06 15:31:44vajraskycreate