legaultmarc / cohort-manager

Utility to manage and explore collections of phenotype data.
2 stars 2 forks source link

Interrupt triggers a small bug in the REPL #22

Open legaultmarc opened 8 years ago

legaultmarc commented 8 years ago

Some commands, like 'update', currently wait for an interactive user response in the terminal. If an interrupt is sent during this stage, the client raises an Exception and it is not recovered:

Traceback (most recent call last):
  File "/Users/legaultmarc/miniconda3/envs/env3/bin/cohort-repl", line 9, in <module>
    load_entry_point('cohort-manager', 'console_scripts', 'cohort-repl')()
  File "/Users/legaultmarc/projects/StatGen/cohort/cohort_manager/scripts/cohort_repl.py", line 1004, in entry_point
    return main(headless=args.headless)
  File "/Users/legaultmarc/projects/StatGen/cohort/cohort_manager/scripts/cohort_repl.py", line 263, in main
    client(port)
  File "/Users/legaultmarc/projects/StatGen/cohort/cohort_manager/scripts/cohort_repl.py", line 293, in client
    headers={"Content-Type": "text/plain"})
  File "/Users/legaultmarc/miniconda3/envs/env3/lib/python3.5/http/client.py", line 1083, in request
    self._send_request(method, url, body, headers)
  File "/Users/legaultmarc/miniconda3/envs/env3/lib/python3.5/http/client.py", line 1118, in _send_request
    self.putrequest(method, url, **skips)
  File "/Users/legaultmarc/miniconda3/envs/env3/lib/python3.5/http/client.py", line 951, in putrequest
    raise CannotSendRequest(self.__state)
http.client.CannotSendRequest: Request-sent