Skip to content

bare-except: sdks/python/pmxt/server_manager.py:475 — bare except: pass in _wait_for_health loop #820

@realfishsam

Description

@realfishsam

Violation

try:
    port = self.get_running_port()
    if self._check_health(port):
        return
except:
    pass

Location

sdks/python/pmxt/server_manager.py:475

Why It Matters

Bare except: in the health-wait polling loop catches KeyboardInterrupt, so pressing Ctrl-C while waiting for the server to start will be silently swallowed — the loop continues until HEALTH_CHECK_TIMEOUT expires and then raises a generic Exception("Server failed to become healthy"). This makes Ctrl-C unusable during server startup.

Suggested Fix

except Exception:
    pass

Or, for the intent of suppressing transient connection errors only, use a narrower exception type.


Found by automated code hygiene audit

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions