- Package:
- python3-pytoolconfig
- Source:
- python3-pytoolconfig
- Submitter:
- Nico Della Torre
- Date:
- 2026-10-17 11:07:05 UTC
- Severity:
- normal
- Tags:
`PyToolConfig._setup_arg_parser()` passes the field type directly to
argparse as `type=`. For `bool` fields this means `bool(<string>)`,
which is `True` for any non-empty string, so a boolean option cannot be
disabled from the command line.
test.py:
from argparse import ArgumentParser
from dataclasses import dataclass
from pathlib import Path
from pytoolconfig import PyToolConfig, field
@dataclass
class Config:
verbose: bool = field(False, command_line=("--verbose",))
config = PyToolConfig("t", Path("."), Config, arg_parser=ArgumentParser())
print(config.parse(["--verbose", "False"]).verbose)
Actual: `True`
Expected: `False`
`--verbose 0` and `--verbose no` give `True` as well; only an empty
string gives `False`.
Possible fixes: register `bool` fields with
`action=argparse.BooleanOptionalAction` (Python 3.9+), or with a
converter that accepts the usual true/false strings.
Reproduced with python3-pytoolconfig 1.3.1-5 (code unchanged in 1.3.1-6)
on Python 3.13 and 3.14, and with upstream main (bee6db4).
This is an upstream bug, it will be forwarded.
We believe that the bug you reported is fixed in the latest version of
pytoolconfig, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 1150755@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Nico Della Torre <nicoz91@ubuntu.com> (supplier of updated pytoolconfig package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Sat, 17 Oct 2026 08:10:24 +0200
Source: pytoolconfig
Architecture: source
Version: 1.3.1-6
Distribution: unstable
Urgency: medium
Maintainer: Debian Python Team <team+python@tracker.debian.org>
Changed-By: Nico Della Torre <nicoz91@ubuntu.com>
Closes: 1093665 1150754 1150755 1150758 1150759 1150760 1150761 1150769 1150770
Changes:
pytoolconfig (1.3.1-6) unstable; urgency=medium
.
* Add myself to Uploaders. (Closes: #1093665)
* Add debian/upstream/metadata.
* Fix capitalization of Python in the package description.
* Add patches fixing upstream bugs, with tests:
- Resolve postponed annotations of configuration models.
(Closes: #1150754)
- Parse boolean command line values explicitly. (Closes: #1150755)
- Convert Enum values when fall_through is enabled. (Closes: #1150758)
- Convert string values to bool, int and float fields.
(Closes: #1150759)
- Return Python versions allowed by requires-python. (Closes: #1150760)
- Give command line arguments precedence over universal configuration.
(Closes: #1150761)
- Read the version from the package metadata. (Closes: #1150769)
- Use the first source configuring the tool even if empty.
(Closes: #1150770)
* Add patch replacing deprecated typing aliases with built-in generics
and collections.abc.
* Add patch updating the README: document the features, add a usage
example and state that Python 3.10 or later is required.
* Run the upstream test suite as autopkgtest with autopkgtest-pkg-pybuild.
Checksums-Sha1:
36ed3a84e89a8f686a543af981401afa5c4c9fdd 2264 pytoolconfig_1.3.1-6.dsc
7cd911425eb5b2d3a890feef5ff2065e394c2fe0 12080 pytoolconfig_1.3.1-6.debian.tar.xz
bf789f3c250a4a2030ec60dd91787bf189b7e2b0 7992 pytoolconfig_1.3.1-6_source.buildinfo
Checksums-Sha256:
cd1b4be669aa1e148b0c61f8881dba6c66ec55e59a19f8f322f481dcf514a749 2264 pytoolconfig_1.3.1-6.dsc
b7918aa88e766c6c5689e2e2d44e5a7f35651bea3f438bb892494b96fbc94eda 12080 pytoolconfig_1.3.1-6.debian.tar.xz
3cdfba08bc1c41892611429209655695905e76f1b47ac3410c84c6e17e1ece6e 7992 pytoolconfig_1.3.1-6_source.buildinfo
Files:
e26208a5e963536ebc382b72dccebfb7 2264 python optional pytoolconfig_1.3.1-6.dsc
e38e9a0dae1fec519a691a5b7cac3fcc 12080 python optional pytoolconfig_1.3.1-6.debian.tar.xz
3b6c445537532d5c555253c2a6ee009e 7992 python optional pytoolconfig_1.3.1-6_source.buildinfo
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEEj23hBDd/OxHnQXSHMfMURUShdBoFAmrTUe8ACgkQMfMURUSh
dBrJiA//dLTQsuJR3PNVQ976Zy3uqV9Gp3Qce5hOCRisICuPWlB2wwzy3TLW6NVJ
09yZb3A00MGHzYU4/lxDEZslgdX2+BtZCK0EHSasF8Fo8tD4ZrSfTMZnl0oPGOof
jW2cePcID77LtswPmrc2VbPfxUd46TrUdvOwD8X895mEzjHZMooSQEkqe9L03A16
N8RgUyWzEUsSjJqrM6GWqDOaZmMYLtrLrOqegWu7AYCNJrctjFlUc2ZNrzZ1404Q
VHRQqFI9nLItelTjgmZn1TxMIexPIqBwxMyCVAaT9KBKYH6WgN65gZTxDn0wVFqK
C68szunRPIfMD8oyr00yZmNoTIbPTIBXT+28U81BGSg1KSyW0ZCmb1L/wUA/7k92
WNxexd7qBu2kKRCM9/SEoool2F2pU1xWBHd9R4VN/3knx8yujkY3FX3kfDkCvJp8
pRn90+WymfNCBAC0LZdwYyLdmxeMh7wfnEQGsAkHYEiBE1IP4TmtweQafyDwjq6D
lcYKZIOVSsE3tlzuQ59w24cbDpX5Z/7L5WhSCdoEqn9nvQS3sgCTY7TGa8V6oFwg
40xzW2v2q0QvuZQwJdTYwLmLZ2/KtoXzQqHrYnKnOW2TFqpwh5fb+3+GzYb8Rz+D
S65d734R7N+mWj80Ac/0EB0KVJU9mNxGEi53YorIURgg1N3jQNE=
=zcEU
-----END PGP SIGNATURE-----