[Python forward compat] click.types.Path.covert: BytesWarning: Comparison between bytes and string · Issue #2877 · pallets/click · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I've hit this through pip-tools' pip-compile executable some time ago but forgot to report immediately.
I tend to run Python with strictness like python -I -s -E -bb -Werror -m piptools compile --some --args. And that's how I've found this warning. I imagine, it's easy to address by changing the check here: https://github.com/pallets/click/blob/c9f7d9d/src/click/types.py#L929C64-L929C75. Perhaps, by converting the data type.
Here's a minimal repro. In needs a modern enough Python for -bb IIRC.
$ python -Im pip install Click
$ python -bb -WerrorPython 3.12.9 (main, Feb 22 2025, 21:46:24) [GCC 14.2.1 20241221] on linuxType "help", "copyright", "credits" or "license" for more information.>>> from click.types import Path>>> Path(allow_dash=True).convert('', '', '')Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/path/to/venv/lib/python3.12/site-packages/click/types.py", line 865, in convert is_dash = self.file_okay and self.allow_dash and rv in (b"-", "-") ^^^^^^^^^^^^^^^^^BytesWarning: Comparison between bytes and string
Environment:
Python version: 3.12.9
Click version: 8.1.8
The text was updated successfully, but these errors were encountered:
So I've hit this through pip-tools'
pip-compile
executable some time ago but forgot to report immediately.I tend to run Python with strictness like
python -I -s -E -bb -Werror -m piptools compile --some --args
. And that's how I've found this warning. I imagine, it's easy to address by changing the check here: https://github.com/pallets/click/blob/c9f7d9d/src/click/types.py#L929C64-L929C75. Perhaps, by converting the data type.Here's a minimal repro. In needs a modern enough Python for
-bb
IIRC.Environment:
The text was updated successfully, but these errors were encountered: