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.

classification
Title: xmlrpclib docs include incorrect file closing
Type: Stage:
Components: Documentation Versions: Python 3.0, Python 3.1, Python 2.7, Python 2.6, Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: georg.brandl, ironfroggy
Priority: normal Keywords: patch

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:45adminsetgithub: 49424
2009-02-07 12:21:27georg.brandlsetstatus: open -> closed
resolution: fixed
messages: + msg81335
2009-02-06 22:20:02ironfroggysetmessages: + msg81310
2009-02-06 22:19:23ironfroggycreate