[Python-checkins] python/dist/src/Lib ConfigParser.py,1.64,1.65

fdrake at users.sourceforge.net fdrake at users.sourceforge.net
Mon May 17 23:29:54 EDT 2004


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11581/Lib
Modified Files:
	ConfigParser.py 
Log Message:
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)
Index: ConfigParser.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/ConfigParser.py,v
retrieving revision 1.64
retrieving revision 1.65
diff -C2 -d -r1.64 -r1.65
*** ConfigParser.py	18 May 2004 02:25:50 -0000	1.64
--- ConfigParser.py	18 May 2004 03:29:52 -0000	1.65
***************
*** 344,347 ****
--- 344,349 ----
 def set(self, section, option, value):
 """Set an option."""
+ if not isinstance(value, basestring):
+ raise TypeError("option values must be strings")
 if not section or section == DEFAULTSECT:
 sectdict = self._defaults


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /