diff --git a/lbrynet/conf.py b/lbrynet/conf.py index dfa273063..ef1a49533 100644 --- a/lbrynet/conf.py +++ b/lbrynet/conf.py @@ -228,9 +228,8 @@ class Servers(Setting[list]): def contribute_to_argparse(self, parser: ArgumentParser): parser.add_argument( self.cli_name, - nargs="*", help=self.doc, - default=NOT_SET + action='append' ) @@ -269,7 +268,7 @@ class ArgumentAccess: def load(self, args): for setting in self.configuration.get_settings(): value = getattr(args, setting.name, NOT_SET) - if value != NOT_SET: + if value != NOT_SET and not (isinstance(setting, Servers) and value is None): self.args[setting.name] = setting.deserialize(value) def __contains__(self, item: str): diff --git a/tests/unit/test_conf.py b/tests/unit/test_conf.py index ba0cb1fec..4c37e921b 100644 --- a/tests/unit/test_conf.py +++ b/tests/unit/test_conf.py @@ -76,7 +76,7 @@ class ConfigurationTests(unittest.TestCase): self.assertFalse(c.test_true_toggle) self.assertFalse(c.test_false_toggle) - args = parser.parse_args(['--servers', 'localhost:1', '192.168.0.1:2']) + args = parser.parse_args(['--servers=localhost:1', '--servers=192.168.0.1:2']) c = TestConfig.create_from_arguments(args) self.assertEqual(c.servers, [('localhost', 1), ('192.168.0.1', 2)])