Łukasz Langa added the comment:

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.

----------
resolution:  -> wont fix
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue16374>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to