<#18349 Providing a positional argument to a targe...
# github-notifications
q
#18349 Providing a positional argument to a target leads to non-specific `TypeError: __call__() takes ...` error Issue created by huonw Describe the bug All targets take keyword arguments only, and passing a positional argument like
python-sources("x")
accidentally is an error, but this error isn't specific about the location of the problem, which makes it hard to find.
Copy code
cd "$(mktemp -d)"
echo 'python_sources("x")' > BUILD

cat > pants.toml <<EOF
[GLOBAL]
pants_version = "2.14.0"
backend_packages = ["pants.backend.python"]

[anonymous-telemetry]
enabled = false
EOF

pants dependencies ::
#>   MappingError: Failed to parse ./BUILD:
#> __call__() takes 1 positional argument but 2 were given
It'd be great if the error at least pointed to the line, and would be even better if the raw Python-generated
TypeError
was translated into something meaningful for Pants users. Pants version 2.14.0, 2.16.0.dev7 OS macOS Additional info Add any other information about the problem here, such as attachments or links to gists, if relevant. pantsbuild/pants