Skip to content
This repository was archived by the owner on Nov 23, 2017. It is now read-only.
This repository was archived by the owner on Nov 23, 2017. It is now read-only.

BaseSubprocessTransport can raise in __del__ #473

Open
@Tinche

Description

@Tinche

What's our policy on raising exceptions in destructors?

For example, this code:

self.close()
can potentially throw if the event loop as been closed already (or for any unforeseen reason, really). I've had this happen to me while testing a piece of asyncio code, with the exception coming up ten tests later.

Shouldn't this be wrapped in a try/except, and the exception just logged, not propagated? We generally can't know when a destructor will be triggered.

I can put together a small pull request if that's ok.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions