nschloe / tuna

:fish: Python profile viewer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

running tuna multiple times fails

matkoniecz opened this issue · comments

I started tuna once (to see state before change) and then again (to see state after change)

It resulted in

Traceback (most recent call last):
  File "/home/mateusz/.local/bin/tuna", line 10, in <module>
    sys.exit(main())
  File "/home/mateusz/.local/lib/python3.5/site-packages/tuna/cli.py", line 33, in main
    start_server(args.infile, args.browser, args.port)
  File "/home/mateusz/.local/lib/python3.5/site-packages/tuna/main.py", line 212, in start_server
    httpd = HTTPServer(("", port), StaticServer)
  File "/usr/lib/python3.5/socketserver.py", line 440, in __init__
    self.server_bind()
  File "/usr/lib/python3.5/http/server.py", line 138, in server_bind
    socketserver.TCPServer.server_bind(self)
  File "/usr/lib/python3.5/socketserver.py", line 454, in server_bind
    self.socket.bind(self.server_address)
OSError: [Errno 98] Address already in use

Ah, you'll just have to use another port, e.g., tuna -p 8001.

FYI, tuna now automatically selects a free port.