pypi ConfigArgParse 1.10.2

58 minutes ago

Fixes a regression in 1.10.0 and 1.10.1, and a bug in how TomlConfigParser reads section names.

  • None as a command line arg works again (#372). parser.parse_args(['--foo', None]) raised TypeError: object of type 'NoneType' has no len() in 1.10.0 and 1.10.1. It gives foo=None again, as 1.9.0 and plain argparse do. The same goes for 0 and False.
  • A quoted part of a TOML section name can now hold a dot when it is in single quotes or comes after a space (#370). TomlConfigParser(["tool.'a.b'"]) and TomlConfigParser(['tool . "a.b"']) now read the table [tool."a.b"]. Before, both names were split at the dot inside the quotes, so that table's settings were silently not read (tool."a.b" already worked). Writing a config file with such a section name now writes [tool."a.b"] too.

With that fix, the quoted parts of a section name follow TOML's rules more closely:

  • Backslash escapes are read in a double-quoted part and left as they are in a single-quoted part.
  • Spaces inside double quotes are kept. tool." a " used to be read as tool.a.
  • A quote character in the middle of an unquoted part, which isn't valid TOML, now starts a quoted part, so tool.it's.x is no longer split at the second dot. Write it as tool."it's".x, which works in earlier versions too.

Full changelog: v1.10.1...v1.10.2

Don't miss a new ConfigArgParse release

NewReleases is sending notifications on new releases.