Issue 5174: xmlrpclib docs include incorrect file closing (original) (raw)

Issue5174

Created on 2009-02-06 22:19 by ironfroggy, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
xmlrpc_doc.patch ironfroggy,2009-02-06 22:19
Messages (3)
msg81309 - (view) Author: Calvin Spealman (ironfroggy) Date: 2009-02-06 22:19
The following example from the xmlrpclib docs has an obviously erronous call to close() after the actual return. (http://docs.python.org/library/xmlrpclib.html) def python_logo(): handle = open("python_logo.jpg") return xmlrpclib.Binary(handle.read()) handle.close() The patch included also makes the whitespace PEP-8 compliant.
msg81310 - (view) Author: Calvin Spealman (ironfroggy) Date: 2009-02-06 22:20
The patch attached uses a with statement for proper file closing in the examples.
msg81335 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2009-02-07 12:21
Thanks, fixed in r69409.
History
Date User Action Args
2022-04-11 14:56:45 admin set github: 49424
2009-02-07 12:21:27 georg.brandl set status: open -> closedresolution: fixedmessages: +
2009-02-06 22:20:02 ironfroggy set messages: +
2009-02-06 22:19:23 ironfroggy create