File: configparser.patch

package info (click to toggle)
q2-quality-control 2024.5.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,464 kB
  • sloc: python: 4,354; makefile: 38; sh: 14; javascript: 1
file content (27 lines) | stat: -rw-r--r-- 1,515 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From: Athos Ribeiro <athos.ribeiro@canonical.com>                               
Date: Mon, 3 Jun 2024 11:31:54 -0300                                            
Subject: Use ConfigParser instead of SafeConfigParser                   
                                                                                
The configparser's SafeConfigParser has been renamed to ConfigParser in         
Python 3.2 [1]. It was finally removed in Python 3.12 [2].                      
                                                                                
[1] https://docs.python.org/dev/whatsnew/3.2.html#configparser                  
[2] https://docs.python.org/3/whatsnew/3.12.html#configparser                   
                                                                                
Last-Update: 2024-06-03                                                         
Forwarded: not-needed, see https://github.com/qiime2/q2-sample-classifier/pull/229

--- q2-types.orig/versioneer.py
+++ q2-types/versioneer.py
@@ -340,9 +340,9 @@
     # 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):