Message174498
Well, the inline comment syntax was awkward to start with, that's why inline comments are now disabled by default since Python 3.2.
For a more predictable situation with regard to comment handling, consider using the configparser 3.2+ backport for Python 2.6 and 2.7: http://pypi.python.org/pypi/configparser
As for the original report, Michael is on the right track. Semicolon gets treated as a beginning of an inline comment if it's preceeded by a space, unless it's right after the key-value delimiter. In other words, these are inline comments:
key1 = value ;inline comment!
key2 =value ;inline comment!
key3= value ;inline comment!
key4=value ;inline comment!
key5 : value ;inline comment!
key6 :value ;inline comment!
key7: value ;inline comment!
key8:value ;inline comment!
while these are not:
key10 = value;value;value
key11 = value;
key12=;
key13:;
key14= ;
key15: ;
key16 = ;
key17 : ;
key18 : ; ;gotcha!
Yes, key18's value is "; ;gotcha!" which is also a quirk of the old ConfigParser. Moreover, # can be used for full-line comments but not for inline comments. |
|
Date |
User |
Action |
Args |
2012-11-02 09:20:42 | lukasz.langa | set | recipients:
+ lukasz.langa, michaelgruenewald, berker.peksag, Daniel.Gordon |
2012-11-02 09:20:42 | lukasz.langa | set | messageid: <1351848042.55.0.420075696126.issue16374@psf.upfronthosting.co.za> |
2012-11-02 09:20:42 | lukasz.langa | link | issue16374 messages |
2012-11-02 09:20:41 | lukasz.langa | create | |
|