mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
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)
This commit is contained in:
parent
bc12b01d83
commit
abc086fb0d
3 changed files with 36 additions and 1 deletions
|
@ -238,7 +238,9 @@ option in the given \var{section}.
|
|||
|
||||
\begin{methoddesc}{set}{section, option, value}
|
||||
If the given section exists, set the given option to the specified value;
|
||||
otherwise raise \exception{NoSectionError}.
|
||||
otherwise raise \exception{NoSectionError}. \var{value} must be a
|
||||
string (\class{str} or \class{unicode}); if not, \exception{TypeError}
|
||||
is raised.
|
||||
\versionadded{1.6}
|
||||
\end{methoddesc}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue