Repository: numpy/numpy

Issue:
numpy fails to install if it encounters paths with percent in them due to bad ConfigParser usage
That's a bug that was discovered first on https://github.com/pydata/numexpr/issues/217 and which breaks installation completly.

Other references that explain why RawConfigParser is needed: https://bugs.python.org/issue24086

I already have a PR which I tested and it seems that is fixing this issue.

numpy fails to install if it encounters paths with percent in them due to bad ConfigParser usage
That's a bug that was discovered first on https://github.com/pydata/numexpr/issues/217 and which breaks installation completly.

Other references that explain why RawConfigParser is needed: https://bugs.python.org/issue24086

I already have a PR which I tested and it seems that is fixing this issue.

numpy fails to install if it encounters paths with percent in them due to bad ConfigParser usage
That's a bug that was discovered first on https://github.com/pydata/numexpr/issues/217 and which breaks installation completly.

Other references that explain why RawConfigParser is needed: https://bugs.python.org/issue24086

I already have a PR which I tested and it seems that is fixing this issue.



Discussion:

Resolving patch:
diff --git a/numpy/distutils/npy_pkg_config.py b/numpy/distutils/npy_pkg_config.py
--- a/numpy/distutils/npy_pkg_config.py
+++ b/numpy/distutils/npy_pkg_config.py
@@ -5,9 +5,9 @@
 import os
 
 if sys.version_info[0] < 3:
-    from ConfigParser import SafeConfigParser, NoOptionError
+    from ConfigParser import RawConfigParser, NoOptionError
 else:
-    from configparser import ConfigParser, SafeConfigParser, NoOptionError
+    from configparser import RawConfigParser, NoOptionError
 
 __all__ = ['FormatError', 'PkgNotFound', 'LibraryInfo', 'VariableSet',
         'read_config', 'parse_flags']
@@ -259,11 +259,7 @@ def parse_config(filename, dirs=None):
     else:
         filenames = [filename]
 
-    if sys.version[:3] > '3.1':
-        # SafeConfigParser is deprecated in py-3.2 and renamed to ConfigParser
-        config = ConfigParser()
-    else:
-        config = SafeConfigParser()
+    config = RawConfigParser()
 
     n = config.read(filenames)
     if not len(n) >= 1:
diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py
--- a/numpy/distutils/system_info.py
+++ b/numpy/distutils/system_info.py
@@ -129,9 +129,15 @@
 from glob import glob
 from functools import reduce
 if sys.version_info[0] < 3:
-    from ConfigParser import NoOptionError, ConfigParser
+    from ConfigParser import NoOptionError
+    from ConfigParser import RawConfigParser as ConfigParser
 else:
-    from configparser import NoOptionError, ConfigParser
+    from configparser import NoOptionError
+    from configparser import RawConfigParser as ConfigParser
+# It seems that some people are importing ConfigParser from here so is 
+# good to keep its class name. Use of RawConfigParser is needed in 
+# order to be able to load path names with percent in them, like 
+# `feature%2Fcool` which is common on git flow branch names.
 
 from distutils.errors import DistutilsError
 from distutils.dist import Distribution


Test patch: