[issue5409] ConfigParser get methods broken

2009-03-02 Thread Sylvain Rabot

New submission from Sylvain Rabot :

Python 3.0 (r30:67507, Dec  3 2008, 20:14:27) [MSC v.1500 32 bit
(Intel)] on win32
Type "copyright", "credits" or "license()" for more information.


Personal firewall software may warn about the connection IDLE
makes to its subprocess using this computer's internal loopback
interface.  This connection is not visible on any external
interface and no data is sent to or received from the Internet.


IDLE 3.0  
>>> from configparser import ConfigParser
>>> config = ConfigParser()
>>> config.add_section("popo")
>>> config.set("popo", "int", 123)
>>> config.getint("popo", "int")
Traceback (most recent call last):
  File "", line 1, in 
config.getint("popo", "int")
  File "c:\Python30\lib\configparser.py", line 340, in getint
return self._get(section, int, option)
  File "c:\Python30\lib\configparser.py", line 337, in _get
return conv(self.get(section, option))
  File "c:\Python30\lib\configparser.py", line 545, in get
return self._interpolate(section, option, value, d)
  File "c:\Python30\lib\configparser.py", line 585, in _interpolate
if "%(" in value:
TypeError: argument of type 'int' is not iterable
>>> config.set("popo", "bool", True)
>>> config.getboolean("popo", "bool")
Traceback (most recent call last):
  File "", line 1, in 
config.getboolean("popo", "bool")
  File "c:\Python30\lib\configparser.py", line 349, in getboolean
v = self.get(section, option)
  File "c:\Python30\lib\configparser.py", line 545, in get
return self._interpolate(section, option, value, d)
  File "c:\Python30\lib\configparser.py", line 585, in _interpolate
if "%(" in value:
TypeError: argument of type 'bool' is not iterable
>>> config.set("popo", "float", 3.21)
>>> config.getfloat("popo", "float")
Traceback (most recent call last):
  File "", line 1, in 
config.getfloat("popo", "float")
  File "c:\Python30\lib\configparser.py", line 343, in getfloat
return self._get(section, float, option)
  File "c:\Python30\lib\configparser.py", line 337, in _get
return conv(self.get(section, option))
  File "c:\Python30\lib\configparser.py", line 545, in get
return self._interpolate(section, option, value, d)
  File "c:\Python30\lib\configparser.py", line 585, in _interpolate
if "%(" in value:
TypeError: argument of type 'float' is not iterable

Same things with python 2.6

--
components: Library (Lib)
messages: 83055
nosy: Absynthe
severity: normal
status: open
title: ConfigParser get methods broken
type: crash
versions: Python 2.6, Python 3.0

___
Python tracker 
<http://bugs.python.org/issue5409>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5409] ConfigParser get methods broken

2009-03-02 Thread Sylvain Rabot

Sylvain Rabot  added the comment:

My bad, ConfigParser.set() needs string values apparently.

___
Python tracker 
<http://bugs.python.org/issue5409>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com