invalid escape sequence in ip\nmap.py
HansAarneLiblik opened this issue · comments
Hans Aarne Liblik commented
After upgrading to v0.10.0 our pytest (with coverage) fails
File "/app/.venv/lib/python3.11/site-packages/netaddr/__init__.py", line 31, in <module>
from netaddr.ip.nmap import valid_nmap_range, iter_nmap_range
File "/app/.venv/lib/python3.11/site-packages/netaddr/ip/nmap.py", line 105
"""
^^^
SyntaxError: invalid escape sequence '\*'
It seems like :param \*nmap_target_spec:
is not a valid docstring
valid_nmap_range
has proper docstring
iter_nmap_range
does not have a proper docstring (as you can't escape the asterisk with backslash)
I think you need to use :param nmap_target_spec:
instead of :param \*nmap_target_spec:
Jakub Stasiak commented
Thank you, fixed in #331 and released in 0.10.1 just now.
Hans Aarne Liblik commented
While that may fix the syntax warning, the IDE docstring would still be incorrect. IMO you need to drop the asterisk all together
Jakub Stasiak commented
Thanks for the note, it looks all right to me.