balta2ar / brotab

Control your browser's tabs from the command line
MIT License
406 stars 29 forks source link

error after closing the last firefox tab #61

Open doctorcolossus opened 2 years ago

doctorcolossus commented 2 years ago

After closing the last Firefox tab, Firefox terminates, which leads to the following brotab error:

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/brotab/api.py", line 287, in close_tabs
    api.close_tabs(args)
  File "/usr/lib/python3.10/site-packages/brotab/api.py", line 104, in close_tabs
    return self._get('/close_tabs/%s' % tabs)
  File "/usr/lib/python3.10/site-packages/brotab/api.py", line 249, in _get
    with urlopen(request, timeout=HTTP_TIMEOUT) as response:
  File "/usr/lib/python3.10/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.10/urllib/request.py", line 519, in open
    response = self._open(req, data)
  File "/usr/lib/python3.10/urllib/request.py", line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.10/urllib/request.py", line 1377, in http_open
    return self.do_open(http.client.HTTPConnection, req)
  File "/usr/lib/python3.10/urllib/request.py", line 1352, in do_open
    r = h.getresponse()
  File "/usr/lib/python3.10/http/client.py", line 1374, in getresponse
    response.begin()
  File "/usr/lib/python3.10/http/client.py", line 318, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.10/http/client.py", line 287, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

ideas to fix: