[Python-bugs-list] [ python-Bugs-441279 ] ConfigParser.options return default opts

noreply@sourceforge.net noreply@sourceforge.net
Sat, 14 Jul 2001 04:11:22 -0700


Bugs item #441279, was opened at 2001-07-14 04:11
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=441279&group_id=5470

Category: Extension Modules
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: eXom (jkuan)
Assigned to: Nobody/Anonymous (nobody)
Summary: ConfigParser.options return default opts

Initial Comment:
I have a config file which has the following sections

------------------
[DEFAULT]

logLevel = 9
port = 17870

[SECURITY]
user = hello

-------------------

On python, if I do the followings:

Python 2.0 (#1, Oct 16 2000, 18:10:03) 
[GCC 2.95.2 19991024 (release)] on linux2
Type "copyright", "credits" or "license" for more
information.
>>> from ConfigParser import *
>>> f = open('/tmp/testrc', 'r')
>>> a = ConfigParser()
>>> a.defaults()
{}
>>> a.readfp(f)
>>> a.defaults()
{'port': '17870', 'loglevel': '9'}
>>> a.options("SECURITY")    
['port', 'user', 'loglevel']     <<<<<<<<!!!!!!!!!
>>> 

I thought a.options("SECURITY") will only return
['user'], however it returns everything including the
default options.

I am a bit confused.

Thanks
Joe

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=441279&group_id=5470