Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Session is not set in object if connection fails, which raises 'AttributeError' on __del__ #746

Copy link
Copy link
@tomasfarias

Description

@tomasfarias
Issue body actions

The session attribute is set on the Connection here:

self.session = Session(
.

If connecting fails (e.g. due to invalid host or credentials) then no session attribute will be set, but __del__ will still be called when the not-fully-initialized Connection instance is destroyed. This causes warnings to be printed to stderr.

A simple fix would be to check if session is set in open or doing the same thing in __del__ only, to keep the semantics of open intact.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.