Skip to content

consider-using-with (R1732) doesn't trigger for Path.open() #7964

Closed
@GideonBear

Description

@GideonBear

Current problem

file = open('foo')          # consider-using-with
file = Path('foo').open()   # no error
path = Path('foo')
file = path.open()          # no error

Desired solution

consider-using-with should trigger on any Path.open call too.
I can try to implement this if it's not too hard.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    False Negative 🦋No message is emitted but something is wrong with the codeNeeds PRThis issue is accepted, sufficiently specified and now needs an implementation

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions