Karthikeyan Singaravelan <tir.kar...@gmail.com> added the comment: I could see some unclosed file handlers as well. The last commit (c56894d305211c98882898f237ff54f620520139) was also made in 2013 and I could see no tests for tools too.
➜ cpython git:(master) ✗ ./python ./Tools/i18n/msgfmt.py -o django-no-patch.mo django.po ./Tools/i18n/msgfmt.py:112: ResourceWarning: unclosed file <_io.BufferedReader name='django.po'> lines = open(infile, 'rb').readlines() ./Tools/i18n/msgfmt.py:199: DeprecationWarning: tostring() is deprecated. Use tobytes() instead. output = generate() ./Tools/i18n/msgfmt.py:202: ResourceWarning: unclosed file <_io.BufferedWriter name='django-no-patch.mo'> open(outfile,"wb").write(output) ➜ cpython git:(bpo34166) ✗ ./python -Werror ./Tools/i18n/msgfmt.py -o django-patch.mo django.po ➜ cpython git:(bpo34166) ✗ sha1sum django-patch.mo ab77140e8638adfdef6d00d6c02cc926f1dc906f django-patch.mo ➜ cpython git:(bpo34166) ✗ sha1sum django-no-patch.mo ab77140e8638adfdef6d00d6c02cc926f1dc906f django-no-patch.mo I will raise a PR. Attaching a sample .po file from django project used in the above command for testing. Thanks ---------- nosy: +xtreak Added file: https://bugs.python.org/file47706/django.po _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue34166> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com