Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.save clobbers comments in config #1691

Open
dgw opened this issue Sep 11, 2019 · 0 comments
Open

.save clobbers comments in config #1691

dgw opened this issue Sep 11, 2019 · 0 comments
Labels
Bug Things to squish; generally used for issues

Comments

@dgw
Copy link
Member

dgw commented Sep 11, 2019

Loaded Sopel, PMed .save, and ran diff. Bit of noise from unrelated testing (for #1688) removed:

--- /home/dgw/.sopel/default.cfg.bak	2019-09-10 17:38:24.848283300 -0500
+++ /home/dgw/.sopel/default.cfg	2019-09-10 17:54:27.508233000 -0500
@@ -1,8 +1,5 @@
-# standalone comment before anything
-
 [core]
 nick = SopelTest
-# comment inside section, between values
 host = irc.rizon.net
 use_ssl = true
 port = 6697
@@ -10,7 +7,6 @@
 enable = 
 	admin
 	reddit
-	# comment in the middle of a value
 	version
 	wikipedia
 	wiktionary
@@ -20,7 +16,6 @@
 channels = 
 
 [wiktionary]
-# standalone comment inside a section
 
 [admin]
 

So that's nice. We're currently (#1687/#1689/#1690) mucking around with ways to avoid ignoring valid config values because of our new, more human-friendly list style (#1628), but this is the other side of that problem: comments getting lost completely when the bot's built-in config editing functions are used. This is a major blocker for #1354, at the very least.

I won't assign this to a milestone just yet. As far as I know, fixing this cleanly would require changing out ConfigParser for a third-party PyPI dependency—something that's not gonna happen for 7.0, certainly. I'm not sure we should do that at all. Maybe this issue is a good argument in favor of switching to YAML? (Probably not.)

@dgw dgw added the Bug Things to squish; generally used for issues label Sep 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Things to squish; generally used for issues
Projects
None yet
Development

No branches or pull requests

1 participant