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 lukasz.langa
Recipients Daniel.Gordon, berker.peksag, lukasz.langa, michaelgruenewald
Date 2012-11-02.09:20:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1351848042.55.0.420075696126.issue16374@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2012-11-02 09:20:42lukasz.langasetrecipients: + lukasz.langa, michaelgruenewald, berker.peksag, Daniel.Gordon
2012-11-02 09:20:42lukasz.langasetmessageid: <1351848042.55.0.420075696126.issue16374@psf.upfronthosting.co.za>
2012-11-02 09:20:42lukasz.langalinkissue16374 messages
2012-11-02 09:20:41lukasz.langacreate