From 5b918afc6fd2ac9cbe0b5bed02ac1ba35a78fa8d Mon Sep 17 00:00:00 2001 From: Thaddeus Crews Date: Wed, 14 Feb 2024 10:28:04 -0600 Subject: Explicitly wrap non-serializable values in json dump --- CHANGES.txt | 11 +++++++---- RELEASE.txt | 2 ++ SCons/Environment.py | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 132b51c..5276033 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -43,6 +43,9 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER method so that the generated function argument list matches the function's prototype when including a header file. + From Thaddeus Crews: + - Explicitly wrap non-serializable values in json dump + From William Deegan: - Fix sphinx config to handle SCons versions with post such as: 4.6.0.post1 @@ -1437,12 +1440,12 @@ RELEASE 3.1.0 - Mon, 20 Jul 2019 16:59:23 -0700 scons: rebuilding `file3' because: the dependency order changed: ->Sources - Old:xxx New:zzz - Old:yyy New:yyy - Old:zzz New:xxx + Old:xxx New:zzz + Old:yyy New:yyy + Old:zzz New:xxx ->Depends ->Implicit - Old:/usr/bin/python New:/usr/bin/python + Old:/usr/bin/python New:/usr/bin/python - Fix Issue #3350 - SCons Exception EnvironmentError is conflicting with Python's EnvironmentError. - Fix spurious rebuilds on second build for cases where builder has > 1 target and the source file is generated. This was causing the > 1th target to not have it's implicit list cleared when the source diff --git a/RELEASE.txt b/RELEASE.txt index 4698e60..2052c78 100644 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -75,6 +75,8 @@ IMPROVEMENTS - The NewParallel scheduler now only adds threads as new work requiring execution is discovered, up to the limit set by -j. This should reduce resource utilization when the achievable parallelism in the DAG is less than the -j limit. +- Dumping an environment with `json` formatting will now explicitly specify if a given + value cannot be serialized. PACKAGING diff --git a/SCons/Environment.py b/SCons/Environment.py index e61ec1f..bb3901c 100644 --- a/SCons/Environment.py +++ b/SCons/Environment.py @@ -1708,7 +1708,7 @@ class Base(SubstitutionEnvironment): elif fmt == 'json': import json def non_serializable(obj): - return str(type(obj).__qualname__) + return '<>' % type(obj).__qualname__ return json.dumps(cvars, indent=4, default=non_serializable) else: raise ValueError("Unsupported serialization format: %s." % fmt) -- cgit v0.12