Skip to content

[configparser] Add several deprecated attributes #14487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

donBarbos
Copy link
Contributor

@donBarbos donBarbos commented Jul 28, 2025

This comment has been minimized.

@brianschubert
Copy link
Member

The same PR also removed a deprecated parameter from ParsingError, which isn't reflected in the stubs yet. Might as well add that as well while we're here!

@donBarbos
Copy link
Contributor Author

The same PR also removed a deprecated parameter from ParsingError, which isn't reflected in the stubs yet. Might as well add that as well while we're here!

Thanks, again it seems to me that it is worth adding some removed deprecated methods since they reflected some capabilities of ParsingError (as in #14457 :-), but I'll be glad if someone agrees that they should be added:

    if sys.version_info < (3, 12):
        @property
        @deprecated("Removed in Python 3.12. Use `source` instead.")
        def filename(self) -> str: ...
        @filename.setter
        @deprecated("Removed in Python 3.12. Use `source` instead.")
        def filename(self, value: str) -> None: ...
        @deprecated("Removed in Python 3.12. Use `parser.read_file()` instead.")
        def readfp(self, fp: Iterable[str], filename: str | None = None) -> None: ...

This comment has been minimized.

@brianschubert
Copy link
Member

Looks like they were documented APIs, so adding them sounds reasonable to me

@donBarbos donBarbos changed the title [configparser] Deprecate SafeConfigParser [configparser] Add several deprecated attributes Jul 29, 2025
@donBarbos
Copy link
Contributor Author

Looks like they were documented APIs, so adding them sounds reasonable to me

Indeed, I didn't notice that they were documented

Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants