This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Remove usage of deprecated configparser.ConfigParser class in the stdlib
Type: behavior Stage: resolved
Components: Distutils, IDLE, Library (Lib) Versions: Python 3.2
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: tarek Nosy List: eric.araujo, lukasz.langa, tarek, vinay.sajip
Priority: high Keywords: needs review, patch

Created on 2010-12-04 16:11 by lukasz.langa, last changed 2022-04-11 14:57 by admin. This issue is now closed.

File name Uploaded Description Edit
issue10627.diff lukasz.langa, 2010-12-04 16:12 Migration to SafeConfigParser from the deprecated ConfigParser
Messages (4)
msg123367 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2010-12-04 16:11
configparser.ConfigParser is deprecated as of 3.2 and thus standard library modules should not use that.

The migration path is trivial and should not introduce any compatibility problems whatsoever. All it needs is to switch usage of ConfigParser to SafeConfigParser.

Please find attached a patch that makes the necessary renames.

For the curious, rationale for the deprecation:
- ConfigParser forces interpolation on users, providing no way of escaping interpolation if necessary
- ConfigParser does not check types given on set() and add*() methods, which may lead to invalid internal state (which will raise exceptions when trying to write() configuration or get() values from it)
- until recently configparser's unit tests assumed no instance customization. ConfigParser's error handling is broken when optionxform is overriden
msg123372 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2010-12-04 17:20
So, as discussed w/ Lukasz:

- distutils1 gets unchanged and the warning is silenced there
- distutils2 uses SafeConfigParser [done]
msg123378 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-12-04 17:37
I’ve changed d2 to use RawConfigParser six months ago:

I don’t think we need the interpolation provided by SafeConfigParser.
msg124102 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2010-12-16 01:44
SafeConfigParser was renamed to ConfigParser in r87299 so this change is no longer necessary.
Date User Action Args
2022-04-11 14:57:09adminsetgithub: 54836
2010-12-16 01:44:46lukasz.langasetstatus: open -> closed

messages: + msg124102
resolution: out of date
stage: patch review -> resolved
2010-12-04 17:37:48eric.araujosetmessages: + msg123378
2010-12-04 17:20:56tareksetmessages: + msg123372
2010-12-04 16:12:58lukasz.langasetnosy: + vinay.sajip
2010-12-04 16:12:25lukasz.langasetfiles: + issue10627.diff
2010-12-04 16:11:01lukasz.langacreate