Georg Brandl
6290bcfc25
Merged revisions 83452,83457,83466,83471,83475,83480,83486 via svnmerge from
...
svn+ssh://pythondev@svn.python.org/python/branches/release27-maint
................
r83452 | georg.brandl | 2010-08-01 23:06:46 +0200 (So, 01 Aug 2010) | 25 lines
Merged revisions 83226-83227,83229-83230,83232 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r83226 | georg.brandl | 2010-07-29 16:17:12 +0200 (Do, 29 Jul 2010) | 1 line
#1090076 : explain the behavior of *vars* in get() better.
........
r83227 | georg.brandl | 2010-07-29 16:23:06 +0200 (Do, 29 Jul 2010) | 1 line
Use Py_CLEAR().
........
r83229 | georg.brandl | 2010-07-29 16:32:22 +0200 (Do, 29 Jul 2010) | 1 line
#9407 : document configparser.Error.
........
r83230 | georg.brandl | 2010-07-29 16:36:11 +0200 (Do, 29 Jul 2010) | 1 line
Use correct directive and name.
........
r83232 | georg.brandl | 2010-07-29 16:49:08 +0200 (Do, 29 Jul 2010) | 1 line
#9388 : remove ERA_YEAR which is never defined in the source code.
........
................
r83457 | georg.brandl | 2010-08-01 23:10:57 +0200 (So, 01 Aug 2010) | 9 lines
Merged revisions 83223 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r83223 | georg.brandl | 2010-07-29 15:38:37 +0200 (Do, 29 Jul 2010) | 1 line
#3874 : document HTMLParser.unknown_decl().
........
................
r83466 | georg.brandl | 2010-08-01 23:23:50 +0200 (So, 01 Aug 2010) | 29 lines
Merged revisions 83160-83161,83166,83168-83169,83171 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r83160 | georg.brandl | 2010-07-26 10:51:42 +0200 (Mo, 26 Jul 2010) | 1 line
#9381 : fix markup.
........
r83161 | georg.brandl | 2010-07-26 11:33:12 +0200 (Mo, 26 Jul 2010) | 1 line
Add Brian Quinlan.
........
r83166 | georg.brandl | 2010-07-26 17:11:49 +0200 (Mo, 26 Jul 2010) | 1 line
Fix grammar.
........
r83168 | georg.brandl | 2010-07-26 19:00:20 +0200 (Mo, 26 Jul 2010) | 1 line
Fix indentation in example.
........
r83169 | georg.brandl | 2010-07-26 19:09:32 +0200 (Mo, 26 Jul 2010) | 1 line
Add Reid.
........
r83171 | georg.brandl | 2010-07-26 23:12:13 +0200 (Mo, 26 Jul 2010) | 1 line
Clarify.
........
................
r83471 | georg.brandl | 2010-08-01 23:26:45 +0200 (So, 01 Aug 2010) | 9 lines
Merged revisions 83106 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r83106 | georg.brandl | 2010-07-23 18:55:26 +0200 (Fr, 23 Jul 2010) | 1 line
Fix some markup glitches.
........
................
r83475 | georg.brandl | 2010-08-01 23:28:47 +0200 (So, 01 Aug 2010) | 9 lines
Merged revisions 82965 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r82965 | georg.brandl | 2010-07-19 13:28:05 +0200 (Mo, 19 Jul 2010) | 1 line
Clarification. Yay importlib!
........
................
r83480 | georg.brandl | 2010-08-01 23:33:42 +0200 (So, 01 Aug 2010) | 17 lines
Merged revisions 82871,82960-82961 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r82871 | georg.brandl | 2010-07-14 10:00:22 +0200 (Mi, 14 Jul 2010) | 1 line
#9258 : fix copy-paste errors.
........
r82960 | georg.brandl | 2010-07-19 08:52:35 +0200 (Mo, 19 Jul 2010) | 1 line
Clarify.
........
r82961 | georg.brandl | 2010-07-19 08:57:52 +0200 (Mo, 19 Jul 2010) | 1 line
Clarify :option: description.
........
................
r83486 | georg.brandl | 2010-08-01 23:44:38 +0200 (So, 01 Aug 2010) | 13 lines
Merged revisions 82832,82834 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r82832 | georg.brandl | 2010-07-12 11:00:29 +0200 (Mo, 12 Jul 2010) | 1 line
Take care of duplicate target name warnings.
........
r82834 | georg.brandl | 2010-07-12 11:06:13 +0200 (Mo, 12 Jul 2010) | 1 line
Use raw string literals for regexes containing backlash.
........
................
2010-08-01 21:48:47 +00:00
Georg Brandl
59e93c9652
Merged revisions 71564 via svnmerge from
...
svn+ssh://pythondev@svn.python.org/python/trunk
........
r71564 | georg.brandl | 2009-04-13 12:36:24 +0000 (Mo, 13 Apr 2009) | 1 line
#5741 followup: should also allow %%(blah)s.
........
2009-04-13 12:37:59 +00:00
Georg Brandl
dcfed0e316
Merged revisions 71537 via svnmerge from
...
svn+ssh://pythondev@svn.python.org/python/trunk
........
r71537 | georg.brandl | 2009-04-12 19:24:11 +0200 (So, 12 Apr 2009) | 1 line
#5741 : dont disallow double percent signs in SafeConfigParser.set() keys.
........
2009-04-12 17:26:19 +00:00
Brett Cannon
97b1fb6a98
Remove a __getitem__() removal on an exception to silence a warning triggered
...
under -3.
2008-08-02 03:37:50 +00:00
Georg Brandl
392c6fc02d
ConfigParser renaming reversal part 3: move module into place and adapt imports.
2008-05-25 07:25:25 +00:00
Alexandre Vassalotti
e3a23c0734
Renamed the ConfigParser module to 'configparser'.
2008-05-14 22:07:07 +00:00
Facundo Batista
b12f0b581a
Issue 1781. Now ConfigParser.add_section does not let you add a
...
DEFAULT section any more, because it duplicated sections with
the rest of the machinery. Thanks Tim Lesher and Manuel Kaufmann.
2008-02-23 12:46:10 +00:00
Brett Cannon
229cee2d3d
Deprecate BaseException.message as per PEP 352.
2007-05-05 01:34:02 +00:00
Georg Brandl
92a6baed7b
Patch #1603688 : ConfigParser.SafeConfigParser now checks values that
...
are set for invalid interpolation sequences that would lead to errors
on reading back those values.
2007-03-13 17:43:32 +00:00
Martin v. Löwis
a00bcac003
Patch #1371075 : Make ConfigParser accept optional dict type
...
for ordering, sorting, etc.
2006-12-03 12:01:53 +00:00
Georg Brandl
7eb4b7d177
Fix all wrong instances of "it's".
2005-07-22 21:49:32 +00:00
David Goodger
1cbf206d32
SF bug #997050 : Document, test, & check for non-string values in ConfigParser. Moved the new string-only restriction added in rev. 1.65 to the SafeConfigParser class, leaving existing ConfigParser & RawConfigParser behavior alone, and documented the conditions under which non-string values work.
2004-10-03 15:55:09 +00:00
David Goodger
68a1abdade
SF bug #1017864 : ConfigParser now correctly handles default keys, processing them with ``ConfigParser.optionxform`` when supplied, consistent with the handling of config file entries and runtime-set options.
2004-10-03 15:40:25 +00:00
Fred Drake
82903148a8
ConfigParser:
...
- read() method returns a list of files parsed successfully
- add tests, documentation
(closes SF patch #677651 )
2004-05-18 04:24:02 +00:00
Fred Drake
abc086fb0d
ConfigParser:
...
- don't allow setting options to non-string values; raise TypeError
when the value is set, instead of raising an arbitrary exception
later (such as when string interpolation is performed)
- add tests, documentation
(closes SF bug #810843 )
2004-05-18 03:29:52 +00:00
Fred Drake
bc12b01d83
ConfigParser:
...
- ensure that option names in interpolations are handled by
self.optionxform in the same way that other references to option
names
- add tests, documentation
(closes SF bug #857881 , patch #865455 )
2004-05-18 02:25:51 +00:00
Raymond Hettinger
bac788a3cd
Replace str.find()!=1 with the more readable "in" operator.
2004-05-04 09:21:43 +00:00
Walter Dörwald
70a6b49821
Replace backticks with repr() or "%r"
...
From SF patch #852334 .
2004-02-12 17:35:32 +00:00
Fred Drake
8c4da53afe
Make both items() methods return lists; one had changed to return an
...
iterator where it probably shouldn't have.
Closes SF bug #818861 .
2003-10-21 16:45:00 +00:00
Walter Dörwald
f0dfc7ac5c
Fix a bunch of typos in documentation, docstrings and comments.
...
(From SF patch #810751 )
2003-10-20 14:01:56 +00:00
Raymond Hettinger
99c2d531d1
SF patch #790443 : add SafeConfigParser to __all__
...
(Contributed by George Yoshida.)
2003-09-01 23:30:44 +00:00
Neal Norwitz
10f3018023
Fix arguments for instantiating InterpolationSyntaxError
2003-06-29 04:23:35 +00:00
Fred Drake
e2c649126e
Further cleanup of exceptions. All interpolation-related exceptions
...
now derive from InterpolationError, which is not raised directly (only
subclasses get raised). This matches what the docs already said.
2002-12-31 17:23:27 +00:00
Fred Drake
00dc5a93c1
ConfigParser._interpolate(): Pass the missing key to the
...
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.)
2002-12-31 06:55:41 +00:00
Fred Drake
8d5dd98a2e
- added InterpolationSyntaxError to __all__
...
- added docstring to exceptions
2002-12-30 23:51:45 +00:00
Neal Norwitz
ce1d944b6b
Add missing InterpolationSyntaxError.
...
XXX Not sure this is correct.
2002-12-30 23:38:47 +00:00
Neal Norwitz
f680cc460c
Update doc for getboolean() to match code (ie, returning True/False)
...
Convert remaining uses of 1/0 to True/False
2002-12-17 01:56:47 +00:00
Tim Peters
230a60c6ec
Whitespace normalization.
2002-11-09 05:08:07 +00:00
Andrew M. Kuchling
9050a517c8
Fix docstring typos
2002-11-06 14:51:20 +00:00
Fred Drake
0eebd5cef9
Implement a safer and more predictable interpolation approach.
...
Closes SF bug #511737 .
2002-10-25 21:52:00 +00:00
Fred Drake
df393bd46a
According to the docs, __name__ is not exposed via the API except
...
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.
2002-10-25 20:41:30 +00:00
Fred Drake
fce6557c6b
Re-factor: Use a RawConfigParser base class and make ConfigParser a
...
derived class that adds the ugly string interpolation code. In the
process, changed all "__" methods and instance variables to "_".
2002-10-25 18:08:18 +00:00
Fred Drake
176916a989
Allow internal whitespace in keys.
...
Closes SF bug #583248 ; backporting to r22-maint branch.
2002-09-27 16:21:18 +00:00
Fred Drake
2ca041fde0
items(): New method, provided by Gustavo Niemeyer in SF bug #545096 .
2002-09-27 15:49:56 +00:00
Fred Drake
c2ff9051d2
has_option(): Use the option name transform consistently.
...
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.
2002-09-27 15:33:11 +00:00
Walter Dörwald
65230a2de7
Remove uses of the string and types modules:
...
x in string.whitespace => x.isspace()
type(x) in types.StringTypes => isinstance(x, basestring)
isinstance(x, types.StringTypes) => isinstance(x, basestring)
type(x) is types.StringType => isinstance(x, str)
type(x) == types.StringType => isinstance(x, str)
string.split(x, ...) => x.split(...)
string.join(x, y) => y.join(x)
string.zfill(x, ...) => x.zfill(...)
string.count(x, ...) => x.count(...)
hasattr(types, "UnicodeType") => try: unicode except NameError:
type(x) != types.TupleTuple => not isinstance(x, tuple)
isinstance(x, types.TupleType) => isinstance(x, tuple)
type(x) is types.IntType => isinstance(x, int)
Do not mention the string module in the rlcompleter docstring.
This partially applies SF patch http://www.python.org/sf/562373
(with basestring instead of string). (It excludes the changes to
unittest.py and does not change the os.stat stuff.)
2002-06-03 15:58:32 +00:00
Raymond Hettinger
54f0222547
SF 563203. Replaced 'has_key()' with 'in'.
2002-06-01 14:18:47 +00:00
Raymond Hettinger
0f4940c0a8
Replaced boolean test with 'is None'
2002-06-01 00:57:55 +00:00
Fred Drake
d451ec1cdb
Clean up uses of some deprecated features.
...
Reported by Neal Norwitz on python-dev.
2002-04-26 02:29:55 +00:00
Tim Peters
bc0e910826
Convert a pile of obvious "yes/no" functions to return bool.
2002-04-04 22:55:58 +00:00
Andrew M. Kuchling
00824ed733
[Bug #523301 ] ConfigParser.write() produces broken output for values that
...
were originally rfc822-like line continuations.
Modified version of a patch from Matthias Ralfs.
2002-03-08 18:08:47 +00:00
Tim Peters
e0c446bb4a
Whitespace normalization.
2001-10-18 21:57:37 +00:00
Guido van Rossum
fb06f75c5a
Apply modified SF patch 467580: ConfigParser.getboolean(): FALSE, TRUE.
...
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.]
2001-10-04 19:58:46 +00:00
Martin v. Löwis
339d0f720e
Patch #445762 : Support --disable-unicode
...
- 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.
2001-08-17 18:39:25 +00:00
Andrew M. Kuchling
7c2cf73811
Remove redefinition of has_option() method
2001-08-13 14:58:32 +00:00
Martin v. Löwis
02d893cfae
Patch #444359 : Remove unused imports.
2001-08-02 07:15:29 +00:00
Fred Drake
beb6713ea7
When reading a continuation line, make sure we still use the transformed
...
name when filling in the internal data structures, otherwise we incorrectly
raise a KeyError.
This fixes SF bug #432369 .
2001-07-06 17:22:48 +00:00
Fred Drake
3c823aa4b6
Make sure ConfigParser uses .optionxform() consistently; this affects
...
.has_option(), .remove_option(), and .set().
This closes SF tracker #232913 .
2001-02-26 21:55:34 +00:00
Fred Drake
d4df94b56d
Be much more permissive in what we accept in section names; there has been
...
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 .
2001-02-14 15:24:17 +00:00
Fred Drake
d83bbbfd22
Allow square brackets in the option names; this makes it possible to use
...
ConfigParser with GNOME-ish config files that use the internationalization
conventions found in GNOME.
This closes SF bug #131635 .
2001-02-12 17:18:11 +00:00