[issue28935] distutils use ConfigParser in Python 3.x and fails to parse setup.cfg with percent sign

2016-12-10 Thread Axel Haustant

New submission from Axel Haustant:

Because of the Python 3.2 configparser renaming/refactoring, string 
interpolation has been enabled into distutils config parsing and so fails to 
read any setup.cfg with percent signs (try to perform string interpolation and 
fails).


To reproduce: create a project with a percent sign anywhere in the setup.cfg 
file and execute python setup.py egg_info.
It will pass on Python 2.x and fails on Python 3.x.

The attached patch suimply disable string interpolation in distutils config 
parsing.

That would be awesome to have this applied on any 3.x version (because project 
using tox to test against different Python versions also fails with the same 
issue Python 3.x and PyPI 3.x)

--
components: Distutils
files: disable-distutils-string-interpolation.patch
keywords: patch
messages: 282865
nosy: Axel Haustant, dstufft, eric.araujo
priority: normal
severity: normal
status: open
title: distutils use ConfigParser in Python 3.x and fails to parse setup.cfg 
with percent sign
type: crash
versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7
Added file: 
http://bugs.python.org/file45839/disable-distutils-string-interpolation.patch

___
Python tracker 
<http://bugs.python.org/issue28935>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28935] distutils use ConfigParser in Python 3.x and fails to parse setup.cfg with percent sign

2016-12-12 Thread Axel Haustant

Axel Haustant added the comment:

You're welcome.

I understand the backward compatibility point. But I think that the current 
state is breaking existing code as it's not documented anywhere and it's a 
side-effect of another change, not something intentionnal.
(this is why I submitted this issue because I'm developing a tool which use the 
setup.cfg file to store data and it is broken in Python 3. I saw a lot of bug 
reports on different tools with the same issue (ex: nosetest configuration)

I cannot use %% for many reason:
- it will not work with Python 2.x (problematic for 2/3 cross compatibility)
- it needs every tools to know that in Python 3, they have to change their 
parser

Right now, I'm supporting configuration into an external file for Python 3.x

Thanks for your response ! I hope that it can be integrated into future 
releases (noted the point on 3.3/3.4).

--

___
Python tracker 
<http://bugs.python.org/issue28935>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28935] distutils use ConfigParser in Python 3.x and fails to parse setup.cfg with percent sign

2016-12-12 Thread Axel Haustant

Axel Haustant added the comment:

No it's not. Same problem but on a different part: the two cited issues are 
about the .pypirc file not the setup.cfg.
The parsing does not occurs at the same place and the fix does not works for 
setup.cfg (I tried before submitting this issue).

In this specific case, setuptools calls distutils to parse the file so the fix 
has to be in distutils not setuptools (whereas for .pypirc, this is setuptools 
which is parsing the file)

--

___
Python tracker 
<http://bugs.python.org/issue28935>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28935] distutils use ConfigParser in Python 3.x and fails to parse setup.cfg with percent sign

2016-12-12 Thread Axel Haustant

Axel Haustant added the comment:

Sorry, it is effectively a duplicate of the second one.
But I submitted a patch which is not present in the other.
What should I do ? (I'll attach the patch to the other one instead)

--

___
Python tracker 
<http://bugs.python.org/issue28935>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20754] Distribution.parse_config_files uses interpolation since Python 3

2016-12-12 Thread Axel Haustant

Axel Haustant added the comment:

I just attached the patch submitted on issue28935.

The fix is to simply give interpolation=None as ConfigParser parameter (as 
documented in the official Python 3.x ConfigParser documentation)

--
keywords: +patch
nosy: +noirbizarre
Added file: 
http://bugs.python.org/file45859/disable-distutils-string-interpolation.patch

___
Python tracker 
<http://bugs.python.org/issue20754>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com