Author xtreak
Recipients lelit, xtreak
Date 2018-07-21.05:34:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1532151297.66.0.56676864532.issue34166@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2018-07-21 05:34:58xtreaksetrecipients: + xtreak, lelit
2018-07-21 05:34:57xtreaksetmessageid: <1532151297.66.0.56676864532.issue34166@psf.upfronthosting.co.za>
2018-07-21 05:34:57xtreaklinkissue34166 messages
2018-07-21 05:34:57xtreakcreate