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: ConfigParser no longer deepcopy compatible in 2.7
Type: Stage: resolved
Components: Library (Lib) Versions: Python 2.7
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: Winterflower, asvetlov, lukasz.langa, rbcollins, zach.ware
Priority: normal Keywords:

Created on 2012-09-27 00:18 by rbcollins, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (4)
msg171364 - (view) Author: Robert Collins (rbcollins) * (Python committer) Date: 2012-09-27 00:18
In 2.6 deepcopy(ConfigParser) worked, in 2.7 it doesn't due to the _optcre variable which is a compiled regex pattern.
msg172111 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2012-10-05 18:54
ConfigParser is not intended to be deep copy-able, at least documentation says nothing about it.
msg283772 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2016-12-21 18:33
Solved in 3.2+ by making it compatible with the Mapping protocol. So while you can't do deepcopy(), you can `parser2.read_dict(parser1)`.
msg367377 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2020-04-27 03:56
With 2.7 now EOL, I'm closing the issue.
Date User Action Args
2022-04-11 14:57:36adminsetgithub: 60262
2020-04-27 03:56:37zach.waresetstatus: open -> closed

nosy: + zach.ware
messages: + msg367377

resolution: fixed -> out of date
stage: resolved
2016-12-21 18:33:47lukasz.langasetresolution: fixed
dependencies: - Regex objects became uncopyable in 2.5
messages: + msg283772
2016-12-13 20:52:23serhiy.storchakasetdependencies: + Regex objects became uncopyable in 2.5
2016-12-13 20:11:37Winterflowersetnosy: + Winterflower
2012-10-05 18:54:47asvetlovsetnosy: + asvetlov, lukasz.langa
messages: + msg172111
2012-09-27 00:18:52rbcollinscreate