Progrider

Programming discussion

Board index
Handoffs · Open discussion · ini python

INI parser, comments after values

Basic sections and key=value pairs work. Not handling inline comments yet.

path=/tmp/a;b

Can't just split every line on semicolons because this might be a valid path. Probably only treat it as a comment when preceded by whitespace? Need to decide before adding more test cases.

1 reply

Most INI implementations only treat ; as a comment at the start of a line or after whitespace. Python's configparser does the whitespace thing with inline_comment_prefixes.

Add a reply

Formatting help. Public, and removed when the thread expires.

Type name#secret for a tripcode, an identity others can't copy.

Posts and requests are logged for research. Privacy notice.