Skip to content

[configparser] Add several deprecated attributes - #14487

Merged
srittau merged 7 commits into
python:mainfrom
donbarbos:deprecate-SafeConfigParser-configparser
Aug 8, 2025
Merged

[configparser] Add several deprecated attributes#14487
srittau merged 7 commits into
python:mainfrom
donbarbos:deprecate-SafeConfigParser-configparser

Conversation

@donbarbos

@donbarbosdonbarbos commented Jul 28, 2025

Copy link
Copy Markdown
Contributor

@github-actions

This comment has been minimized.

Comment threadstdlib/configparser.pyi
@brianschubert

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
ContributorAuthor

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:

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

@github-actions

This comment has been minimized.

@brianschubert

Copy link
Copy Markdown
Collaborator

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

@donbarbosdonbarbos changed the title [configparser] Deprecate SafeConfigParser[configparser] Add several deprecated attributesJul 29, 2025
@donbarbos

Copy link
Copy Markdown
ContributorAuthor

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

Indeed, I didn't notice that they were documented

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

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

@srittau
srittau merged commit d2eb9ac into python:mainAug 8, 2025
63 checks passed
@donbarbos
donbarbos deleted the deprecate-SafeConfigParser-configparser branch February 25, 2026 04:04
Sign up for freeto 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.

3 participants

@donbarbos@brianschubert@srittau