Closed kdave closed 8 years ago
That’s basically the default behaviour of Python’s configparser module. I don’t see a way to change that, without having to write additional code. So as it stands: Don’t except comments to survive in twtxt’s config file. :ghost:
But maybe someone else knows a way?
I had a quick look at the configparser
implementation. There is no built-in way to preserve the comments. The only way I see would be to subclass from configparser.ConfigParser
and overwrite the read and write methods.
I don't think it's worth to do that ...
@timofurrer Yes, that’s what I was thinking about as well.
So best solution seems to be mentioning it somewhere in the docs that comments aren't preserved.
Yeah, I can make this change.
@timofurrer Thanks!
After eg. the follow command, the config gets rewritten and all comments are lost. In my case it was a commented out value of a variable when I did a quick-test of different value. Would be good to preserve the comments or document that they could get removed.