From 65a81afdd9527458b2eb31702883d3e35558cf6f Mon Sep 17 00:00:00 2001 From: Zane Selvans Date: Wed, 11 Sep 2019 19:05:29 -0600 Subject: [PATCH] Change output of None to conform to Windows console foibles. --- src/pudl/workspace/datastore_cli.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/pudl/workspace/datastore_cli.py b/src/pudl/workspace/datastore_cli.py index ae2e1bf717..7f3c14ea63 100644 --- a/src/pudl/workspace/datastore_cli.py +++ b/src/pudl/workspace/datastore_cli.py @@ -26,6 +26,12 @@ def parse_command_line(argv): """ parser = argparse.ArgumentParser(description=__doc__) + # This is necessary because on the Windows console "None" doesn't end up + # getting encoded correctly to print at the console. Somehow. + default_pudl_in = pudl.workspace.setup.get_defaults()["pudl_in"] + if default_pudl_in is None: + default_pudl_in = "None" + parser.add_argument( '-q', '--quiet', @@ -55,7 +61,7 @@ def parse_command_line(argv): type=str, help="""Directory where the datastore should be located. (default: %(default)s).""", - default=pudl.workspace.setup.get_defaults()["pudl_in"] + default=default_pudl_in, ) parser.add_argument( '-s',