diff options
author | Olly Cope <olly@ollycope.com> | 2018-01-29 14:37:50 +0000 |
---|---|---|
committer | Olly Cope <olly@ollycope.com> | 2018-01-29 14:37:50 +0000 |
commit | 117de0adfad7432b4c82719b2cffe36b60f33819 (patch) | |
tree | 62357904ee0ac51198a2a5dc40c65fc076b69cd7 | |
parent | 75c18820e86d156cd5ebdd0769e57aec3350f778 (diff) | |
download | yoyo-117de0adfad7432b4c82719b2cffe36b60f33819.tar.gz |
Fix error trying to save database urls in the config that contain percents
-rwxr-xr-x | yoyo/scripts/main.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/yoyo/scripts/main.py b/yoyo/scripts/main.py index bf97140..5bb7c14 100755 --- a/yoyo/scripts/main.py +++ b/yoyo/scripts/main.py @@ -262,7 +262,8 @@ def main(argv=None): if args.sources: config.set('DEFAULT', 'sources', ' '.join(args.sources)) if args.database: - config.set('DEFAULT', 'database', args.database) + # ConfigParser requires that any percent signs in the db uri be escaped. + config.set('DEFAULT', 'database', args.database.replace('%', '%%')) config.set('DEFAULT', 'migration_table', args.migration_table) config.set('DEFAULT', 'batch_mode', 'on' if args.batch_mode else 'off') config.set('DEFAULT', 'verbosity', str(args.verbosity)) |