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 dveeden
Recipients dveeden
Date 2014-04-22.15:27:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1398180453.28.0.0252275500481.issue21329@psf.upfronthosting.co.za>
In-reply-to
Content
With Python 2.7 the ConfigParser was enriched with the allow_no_value option which resulted in a much more usable configparser for MySQL configs.

It can now parse configs like this:
[mysqld]
log_bin
innodb_file_per_table
innodb_io_capacity=800

However it can't parse this config:
[mysqld]
log_bin
innodb_file_per_table
innodb_io_capacity=800
replicate-do-db="test1"
replicate-do-db="test2"

A comma separated config might have been better, but that's not the case with many MySQL config (and probably doesn't even work for this option).

From http://dev.mysql.com/doc/refman/5.6/en/replication-options-slave.html#option_mysqld_replicate-do-db
"To specify more than one database, use this option multiple times, once for each database"


The dict/orderedDict which is used by configparser doesn't easlily allow to store a config like this.

The MySQL config file is used as an example in the documentation:
https://docs.python.org/3/library/configparser.html#customizing-parser-behaviour

This could be solved by having a list of values if the key exists more than once.

Python 3 improves this a bit by giving a DuplicateOptionError by default.
History
Date User Action Args
2014-04-22 15:27:33dveedensetrecipients: + dveeden
2014-04-22 15:27:33dveedensetmessageid: <1398180453.28.0.0252275500481.issue21329@psf.upfronthosting.co.za>
2014-04-22 15:27:33dveedenlinkissue21329 messages
2014-04-22 15:27:32dveedencreate