Show human-readable message when infinite recursion is detected while processing "Interpolation of Values" // Resolve #3883

This commit is contained in:
Ivan Kravets
2021-10-24 22:21:15 +03:00
parent 78182fea0a
commit 7d7480c120
2 changed files with 9 additions and 3 deletions

View File

@ -11,9 +11,10 @@ PlatformIO Core 5
5.2.3 (2021-??-??)
~~~~~~~~~~~~~~~~~~
- Show human-readable message when infinite recursion is detected while processing `Interpolation of Values <https://docs.platformio.org/page/projectconf/interpolation.html>`__ (`issue #3883 <https://github.com/platformio/platformio-core/issues/3883>`_)
- Improved directory interpolation (``${platformio.***_dir}``) in `"platformio.ini" <https://docs.platformio.org/page/projectconf.html>`__ configuration file (`issue #3934 <https://github.com/platformio/platformio-core/issues/3934>`_)
- Disabled resolving of SCons variables (e.g., ``${SOURCE.get_abspath()}``) when preprocessing `Interpolation of Values <https://docs.platformio.org/page/projectconf/interpolation.html>`__ (`issue #3933 <https://github.com/platformio/platformio-core/issues/3933>`_)
- Fixed an issue when the "$PROJECT_DIR" variable was not properly replaced in the ``debug_server`` option (`issue #4086 <https://github.com/platformio/platformio-core/issues/4086>`_)
- Ignore resolving of SCons variables (e.g., ``${SOURCE.get_abspath()}``) when preprocessing interpolations (`issue #3933 <https://github.com/platformio/platformio-core/issues/3933>`_)
- Fixed an issue when the "$PROJECT_DIR" variable was not properly replaced in the `debug_server <https://docs.platformio.org/page/projectconf/section_env_debug.html#debug-server>`__ option (`issue #4086 <https://github.com/platformio/platformio-core/issues/4086>`_)
5.2.2 (2021-10-20)

View File

@ -294,7 +294,12 @@ class ProjectConfigBase(object):
section, option = match.group(1), match.group(2)
if section == "sysenv":
return os.getenv(option)
value = self.getraw(section, option)
try:
value = self.getraw(section, option)
except RecursionError:
raise exception.ProjectOptionValueError(
"Infinite recursion has been detected", option, section
)
if isinstance(value, list):
return "\n".join(value)
return value