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.

Title: Fix ResourceWarning in
Type: behavior Stage: resolved
Components: Demos and Tools, Documentation Versions: Python 2.7
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: David Bieber, Tiger-222, docs@python, terry.reedy
Priority: normal Keywords: patch

Created on 2018-08-25 15:09 by Tiger-222, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 8926 merged Tiger-222, 2018-08-25 15:15
Messages (5)
msg324071 - (view) Author: Mickaël Schoentgen (Tiger-222) * Date: 2018-08-25 15:09
Fix 2 unclosed files in the documentation and the script: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/tmpnby8pemn' mode='U' encoding='UTF-8'>
    fromlines = open(fromfile, 'U').readlines() ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/tmpnby8pemm' mode='U' encoding='UTF-8'>
    self.tolines = open(tofile, 'U').readlines()
msg324072 - (view) Author: Mickaël Schoentgen (Tiger-222) * Date: 2018-08-25 15:18
This is a little patch to mostly keep aligned with
msg324485 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-09-03 01:44
The change to Tools/scripts/ us effectively a backport of the the patch merged for #7582. The git log  labels it as a2637729f23dc993e820fd92f0d1759ad714c9b2.

The change to Doc/library/difflib.rst does not apply to current 3.x as the test code is no longer present.
msg324486 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-09-03 01:48
New changeset 30af2e737aad427d4da97f8dadeeecff6c2b28f5 by Terry Jan Reedy (Mickaël Schoentgen) in branch '2.7':
bpo-34500: Fix ResourceWarning in (GH-8926)
msg324487 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-09-03 01:50
Using 'with open' is now standard.  Thanks for the update.
In the message above, /us/is/.
Date User Action Args
2022-04-11 14:59:05adminsetgithub: 78681
2018-09-03 01:50:50terry.reedysetstatus: open -> closed
type: behavior
messages: + msg324487

resolution: fixed
stage: patch review -> resolved
2018-09-03 01:48:17terry.reedysetmessages: + msg324486
2018-09-03 01:44:21terry.reedysetnosy: + terry.reedy
messages: + msg324485
2018-08-25 15:18:51Tiger-222setmessages: + msg324072
2018-08-25 15:15:23Tiger-222setkeywords: + patch
stage: patch review
pull_requests: + pull_request8397
2018-08-25 15:09:38Tiger-222create