Skip to content

Coverage() constructor no longer accepts Path-like objects as config_file #1552

Closed
@JD-Veiga

Description

@JD-Veiga

Hi,

I have just discovered that Coverage() constructor only accepts a string as a config_file path now. I have built some automations around coverage and, until now, these scripts can pass a pathlib.Path as config_file to Coverage() —and it works.

Specifically, coverage now asserts that config_file is a string (coverage/config.py line 555).

I rather prefer that config_file can accept any Path-like object. I understand that coverage is mostly invoked via CLI a string seems a natural solution. However, when coverage is invoked programmatically it makes sense —at least to me— that Coverage() accepts strings and pathlib.Paths as well.

Of course, this is a minor issue —not really a bug.

I am running coverage 7.1.0 on Python 3.11.1

Thank you for your time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiChanges to the public APIbugSomething isn't workingfixed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions