[issue5174] xmlrpclib docs include incorrect file closing

2009-02-07 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Thanks, fixed in r69409.

--
resolution:  - fixed
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5174
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5174] xmlrpclib docs include incorrect file closing

2009-02-06 Thread Calvin Spealman

New submission from Calvin Spealman ironfro...@users.sourceforge.net:

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.

--
assignee: georg.brandl
components: Documentation
files: xmlrpc_doc.patch
keywords: patch
messages: 81309
nosy: georg.brandl, ironfroggy
severity: normal
status: open
title: xmlrpclib docs include incorrect file closing
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 3.1
Added file: http://bugs.python.org/file12961/xmlrpc_doc.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5174
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5174] xmlrpclib docs include incorrect file closing

2009-02-06 Thread Calvin Spealman

Calvin Spealman ironfro...@users.sourceforge.net added the comment:

The patch attached uses a with statement for proper file closing in the 
examples.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5174
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com