This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lpangelrob
Recipients
Date 2005-07-08.20:50:34
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
This is better demonstrated than described:

Assume the following "myconfig.cfg" in the current
directory...

[main]
OPT=no
<newline>

The following occurs from the command line:

Python 2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32
bit (Intel)] on win32
<snip>
>>> from ConfigParser import ConfigParser
>>> p = ConfigParser()
>>> p.read('myconfig.cfg')
['myconfig.cfg']
>>> configWord = p.get('main','OPT')
>>> configWord
'no'
>>> word = 'no'
>>> word
'no'
>>> configWord is word
False
>>> word2 = 'no'
>>> word2
'no'
>>> word2 is word
True
>>> len(word)
2
>>> len(configWord)
2
>>> type(configWord)
<type 'str'>
>>> type(word)
<type 'str'>

In other words, the config values ConfigParser
generates look a lot like strings, have types like
strings, and have the same lengths as strings, but
can't be compared as strings. This smells like a bug.
History
Date User Action Args
2007-08-23 14:33:01adminlinkissue1234965 messages
2007-08-23 14:33:01admincreate