port-forward icon indicating copy to clipboard operation
port-forward copied to clipboard

Wrong port parsing

Open Bosek opened this issue 6 years ago • 2 comments

./port-forward.py -v -e 31313 -r 10.0.0.1
Discovering routers...
Found 2 UPnP routers:  10.0.0.1:5431 192.168.1.2:1900
Traceback (most recent call last):
  File "./port-forward.py", line 240, in <module>
    status,message = open_port(service_url,args.eport,internal_client=localip,internal_port=args.iport,protocol=args.protocol,duration=args.time,description=args.description,enabled = enabled)
  File "./port-forward.py", line 155, in open_port
    conn = httplib.HTTPConnection(parsedurl.hostname, parsedurl.port)
  File "/usr/lib/python2.7/urlparse.py", line 113, in port
    port = int(port, 10)
ValueError: invalid literal for int() with base 10: '5431None'

I have no idea what might be causing it. Doesn't work on both Python 2 and 3, Debian.

Bosek avatar Jul 11 '19 20:07 Bosek

I got this working by changing line 240 from "status,message = open_port(service_url, args.eport... " to "status,message = open_port(path, args.eport... ". I think get_wanip_path(path) in line 224 is causing a problem. Bypassing it seems to fix it for now.

slrendell avatar Apr 23 '20 18:04 slrendell

I cannot replicate this issue any more.

Bosek avatar Apr 25 '20 10:04 Bosek