I'm using configparser and Python 3.3 to create a script which makes some small modifications to config files. These config files often contain commented-out lines, like so:
[Section]
Value1=Foo
;Very important comment
;Another very important comment
Value2=Bar
Understandably, Python strips these out when it writes the new version of the config file, but that's something of a problem. Is there any way to copy the comments into the new config file? (Unfortunately, order is also important. Thanks to the OrderedDict, the order of config options is maintained properly, but the order of comments will need to be maintained as well, which hopefully will not be an issue.)
Thanks!