Repository navigation
Conversation
PyYAML's SafeLoader implements YAML 1.1, so plain scalars such as on, yes,
and 1:20 were loaded as booleans and integers. Configuration files now use
a SafeLoader subclass that applies the YAML 1.2 Core schema, including when
a plain ${VAR} is re-resolved after env substitution.
Fixes open-telemetry#5909
eisen0419
force-pushed
the
fix/declarative-config-yaml-1-2
branch
from
November 14, 2026 07:01
a20da58 to
c8350b7
Compare
|
|
Pull request dashboard statusWaiting on reviewers · refreshed 2026-11-14 07:23 UTC Review the latest changes. Status above doesn't look right?
|
Author
|
/easycla |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Declarative configuration YAML files were parsed with PyYAML's
SafeLoader, which implements YAML 1.1 rather than the YAML 1.2 Core schema specified by the OpenTelemetry file configuration specification. Plain scalars such ason/yes/off/noresolved to booleans,1:20resolved to sexagesimal80,010resolved to octal8, timestamps becamedatetime.date, and standalone${VAR}environment substitutions re-resolved through the same YAML 1.1 rules.This adds a private pure-Python
yaml.loader.SafeLoadersubclass (_YAML12CoreLoader) with isolated Core schema implicit resolvers and explicit!!bool/!!int/!!floatconstructors, without adding any third-party dependency or mutating globalyaml.safe_loadbehavior.Configs that relied on YAML 1.1 boolean words (
disabled: on), sexagesimal scalars, legacy010octals, implicit timestamps, or<<merge keys will now parse according to YAML 1.2 Core rules.Fixes #5909
Type of change
Checklist:
tox -e precommittox -e typecheck