Fixes a regression in 1.10.0 and 1.10.1, and a bug in how TomlConfigParser reads section names.
Noneas a command line arg works again (#372).parser.parse_args(['--foo', None])raisedTypeError: object of type 'NoneType' has no len()in 1.10.0 and 1.10.1. It givesfoo=Noneagain, as 1.9.0 and plain argparse do. The same goes for0andFalse.- 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'"])andTomlConfigParser(['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 astool.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.xis no longer split at the second dot. Write it astool."it's".x, which works in earlier versions too.
Full changelog: v1.10.1...v1.10.2