[New-bugs-announce] [issue34689] Lib/sysconfig.py expands non-variables

Erwan Le Pape report at bugs.python.org
Fri Sep 14 16:11:33 EDT 2018


New submission from Erwan Le Pape <lepaperwan3 at gmail.com>:

Lib/sysconfig.py _parse_makefile needs to expand Makefile-style variables which includes `$()` `${}` variables with a litteral `$` being `$$`.

That last particular point is properly accounted for in the first half of the function when determining values that need expansion and those that don't. However, the second half that actually performs variable expansion doesn't.

Sample breaking input:
VAR1=  VALUE1
VAR2=  VALUE2
VAR3=$${VAR1} ${VAR2}

Output:
Expect: {'VAR1': 'VALUE1', 'VAR2': 'VALUE2', 'VAR3': '$${VAR1} VALUE2'}
Actual: {'VAR1': 'VALUE1', 'VAR2': 'VALUE2', 'VAR3': '$VALUE1 VALUE2'}

I'm working on patching this but I'm putting this here as feedback is welcome.

As far as I could tell, this is a side effect of b2b1217, which patched #24705.

----------
components: Library (Lib)
messages: 325393
nosy: lepaperwan
priority: normal
severity: normal
status: open
title: Lib/sysconfig.py expands non-variables
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34689>
_______________________________________


More information about the New-bugs-announce mailing list