diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2010-08-15 20:21:26 (GMT) |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2010-08-15 20:21:26 (GMT) |
commit | e3c39ae53e0fea7744da2afc83cbeb98539bb840 (patch) | |
tree | ee5ff617bbaa9efe1094591b7f85525661f187fa /Doc/library/configparser.rst | |
parent | dc692740a8609b535b44931b93a290d594b92fd0 (diff) | |
download | cpython-e3c39ae53e0fea7744da2afc83cbeb98539bb840.zip cpython-e3c39ae53e0fea7744da2afc83cbeb98539bb840.tar.gz cpython-e3c39ae53e0fea7744da2afc83cbeb98539bb840.tar.bz2 |
Replace readfp() with read_file() in configparser documentation.
Diffstat (limited to 'Doc/library/configparser.rst')
-rw-r--r-- | Doc/library/configparser.rst | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/library/configparser.rst b/Doc/library/configparser.rst index cefbaa5..c8f68f3 100644 --- a/Doc/library/configparser.rst +++ b/Doc/library/configparser.rst @@ -322,13 +322,13 @@ RawConfigParser Objects 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 @@ indicate that such values should be accepted: ... 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") |