[Python-checkins] r84082 - python/branches/py3k/Doc/library/configparser.rst
florent.xicluna
python-checkins at python.org
Sun Aug 15 22:21:26 CEST 2010
Author: florent.xicluna
Date: Sun Aug 15 22:21:26 2010
New Revision: 84082
Log:
Replace readfp() with read_file() in configparser documentation.
Modified:
python/branches/py3k/Doc/library/configparser.rst
Modified: python/branches/py3k/Doc/library/configparser.rst
==============================================================================
--- python/branches/py3k/Doc/library/configparser.rst (original)
+++ python/branches/py3k/Doc/library/configparser.rst Sun Aug 15 22:21:26 2010
@@ -322,13 +322,13 @@
configuration files in the list will be read. If none of the named files
exist, the :class:`ConfigParser` instance will contain an empty dataset. An
application which requires initial values to be loaded from a file should
- load the required file or files using :meth:`readfp` before calling
+ load the required file or files using :meth:`read_file` before calling
:meth:`read` for any optional files::
import configparser, os
config = configparser.ConfigParser()
- config.readfp(open('defaults.cfg'))
+ config.read_file(open('defaults.cfg'))
config.read(['site.cfg', os.path.expanduser('~/.myapp.cfg')], encoding='cp1250')
.. versionadded:: 3.2
@@ -614,7 +614,7 @@
... skip-innodb # we don't need ACID today
... """
>>> config = configparser.RawConfigParser(allow_no_value=True)
- >>> config.readfp(io.BytesIO(sample_config))
+ >>> config.read_file(io.BytesIO(sample_config))
>>> # Settings with values are treated as before:
>>> config.get("mysqld", "user")
More information about the Python-checkins
mailing list