InterpolationError constructor, not the KeyError exception itself.
(Caught by the new InterpolationError test.)
SafeConfigParser._interpolate_some(): Pass the right number of
arguments to the InterpolationError constructor.
(Caught by pychecker.)
indirectly via %(__name__)s. Not sure why, but maintain the
documented behavior for the new items() method.
Be a little more efficient about how we compute the list of options in
the ConfigParser.items() method.
Closes SF bug #561822.
Integrate the "code cleanup and general bug fix patch" (SF bug #545096),
contributed by Gustavo Niemeyer. This is the portion of that patch that
does not add new functionality.
This patch allows ConfigParser.getboolean() to interpret TRUE,
FALSE, YES, NO, ON and OFF instead just '0' and '1'.
While just allowing '0' and '1' sounds more correct users often
demand to use more descriptive directives in configuration
files. Instead of forcing every programmer do brew his own
solution a system should include the batteries for this.
[My modification to the patch is a slight rewording of the docstring
and use of lowercase instead of uppercase templates. The code is
still case sensitive. GvR.]
- Do not compile unicodeobject, unicodectype, and unicodedata if Unicode is disabled
- check for Py_USING_UNICODE in all places that use Unicode functions
- disables unicode literals, and the builtin functions
- add the types.StringTypes list
- remove Unicode literals from most tests.
at least one addition to the set of accepted characters for every release
since this module was first added; this should take care of the problem
in a more substantial way.
This closes SF bug #132288.
added test script and expected output file as well
this closes patch 103297.
__all__ attributes will be added to other modules without first submitting
a patch, just adding the necessary line to the test script to verify
more-or-less correct implementation.
Do not expose the __name__ when reporting the list of options available
for a section since that is for internal use.
This closes SourceForge bug #115357.
Additionally, define InterpolationDepthError and MAX_INTERPOLATION_DEPTH.
The exception is raised by get*() when value interpolation cannot be
completed within the defined recursion limit. The constant is only
informative; changing it will not affect the allowed depth.
Fix the exit from get() so that None is not returned if the depth is met
or exceeded; either return the value of raise InterpolationDepthError.
self.optionxform(), which (in the default case) caused options spelled
with opper case letters in their name to be inaccessible. Reported by
"Todd R. Palmer" <t2palmer@bellsouth.net> on
activepython@listserv1.ActiveState.com.
a representation of the configuration state in .ini format that can be read
back in by a future read() call. Thus this class is now a back end
for .ini editors as well as parsers.
This patch is complete and tested, but exposes a bug in the ConfigParser
implementation which I have not yet fixed. Because case information is
discarded during parsing, the output of write() has its case smashed.
I wrote this for a SourceForge interface script called forgetool.
Documentation for the new entry points included.
discussed on c.l.py last January. Specifically:
- more characters allowed in section & option names
- if '=' is used to separate the option & value, the value can be
followed by a comment of the form '\s;'
Withdraw the change that Fred just checked in -- it was a poorly
documented feature, not a bug, to ignore I/O errors in read().
The new docstring explains the reason for the feature:
"""
this is designed so that you can specifiy a list of potential
configuration file locations (e.g. current directory, user's home
directory, systemwide directory), and all existing configuration files
in the list will be read.
"""
Also add a lower-level function, readfp(), which takes an open file
object (and optionally a filename).
XXX There are some other problems with this module, but I don't have
time to dig into these; in particular, there are complaints that the
%(name)s substitution from the [DEFAULTS] section doesn't work
correctly.
always lowercasing the option name, call a method optionxform() which
can be overridden. Also make the regexps SECTRE and OPTRE non-private
variables so they can also be overridden.
In the docstring of ConfigParser.py (Python 1.5.2b1):
read(*filenames) -- read and parse the list of named configuration files
should be:
read(filenames) -- read and parse the list of named configuration files
The method accepts a list, not a bunch of positional arguments.
Which is good, the list is much more convenient.