TCP-32764 icon indicating copy to clipboard operation
TCP-32764 copied to clipboard

Error in print("probably not vulnerable (error: {0:s})".format(v))

Open InfoLibre opened this issue 2 years ago • 3 comments

$python3 poc.py --get_credentials --ip $(ip route|grep -Eo 'default via ([0-9.]+)'|sed 's/default via //')
Traceback (most recent call last):
  File "/home/david/Bureau/poc.py", line 58, in <module>
    s.connect((args.ip, args.port))
TimeoutError: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/david/Bureau/poc.py", line 60, in <module>
    print("probably not vulnerable (error: {0:s})".format(v))
TypeError: unsupported format string passed to TimeoutError.__format__

InfoLibre avatar Feb 05 '23 14:02 InfoLibre

What version of python are you using? (python3 -V)

dsoares avatar Feb 06 '23 16:02 dsoares

Python 3.10.6

InfoLibre avatar Feb 06 '23 17:02 InfoLibre

(this is a code suggestion) The code should use the preferred python way to format strings (since 3.6):

print(f"probably not vulnerable (error: {v})")

or just fix to:

print("probably` not vulnerable (error: {0})".format(v))

dsoares avatar Feb 08 '23 17:02 dsoares