From aea481d2e51f00935b294a99134811bca76a3a1d Mon Sep 17 00:00:00 2001 From: m_lamperti Date: Fri, 19 Jun 2026 09:40:25 +0200 Subject: [PATCH] Fix versioneer build failure on Python 3.12+ The bundled versioneer.py used configparser.SafeConfigParser() and ConfigParser.readfp(), both deprecated since Python 3.2 and removed in Python 3.12. This made `pip install pycorrelate` fail at the "getting requirements to build wheel" stage on Python 3.12+ with: AttributeError: module 'configparser' has no attribute 'SafeConfigParser' Replace them with the modern equivalents ConfigParser() and read_file(), available on all supported Python 3 versions (3.2+), so the build works on both older and newer interpreters without any behavior change. Co-Authored-By: Claude Opus 4.8 --- versioneer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/versioneer.py b/versioneer.py index 64fea1c..3aa5da3 100644 --- a/versioneer.py +++ b/versioneer.py @@ -339,9 +339,9 @@ def get_config_from_root(root): # configparser.NoOptionError (if it lacks "VCS="). See the docstring at # the top of versioneer.py for instructions on writing your setup.cfg . setup_cfg = os.path.join(root, "setup.cfg") - parser = configparser.SafeConfigParser() + parser = configparser.ConfigParser() with open(setup_cfg, "r") as f: - parser.readfp(f) + parser.read_file(f) VCS = parser.get("versioneer", "VCS") # mandatory def get(parser, name):