Skip to content

Fix bare except clauses across connection.py, core.py, abstract_launcher.py, __main__.py - #335

Open
koteshyelamati wants to merge 4 commits into
uqfoundation:masterfrom
koteshyelamati:master
Open

Fix bare except clauses across connection.py, core.py, abstract_launcher.py, __main__.py#335
koteshyelamati wants to merge 4 commits into
uqfoundation:masterfrom
koteshyelamati:master

Conversation

@koteshyelamati

Copy link
Copy Markdown

Several bare except: clauses across the codebase catch BaseException, which includes SystemExit, KeyboardInterrupt, and GeneratorExit. This can prevent clean shutdown and mask bugs.

Changes

pathos/connection.py (lines 127, 135)
Replace bare except: with except Exception: in launch(). The handler re-raises as PipeException — there is no reason to catch interpreter signals.

pathos/core.py (line 265)
Replace bare except: with except Exception: in randomport(). The handler re-raises as TunnelException.

pathos/abstract_launcher.py (line 178)
Replace bare except: pass with except Exception: pass in _launcher_proxy(). Silently swallowing KeyboardInterrupt or SystemExit here would prevent clean process exit.

pathos/__main__.py (lines 78, 87, 104, 120)
Replace bare except: with except IndexError: for sys.argv access. The only exception that can be raised by sys.argv[N] for a missing argument is IndexError — catching everything is overly broad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant