Skip to content
Snippets Groups Projects
Select Git revision
  • master default protected
  • juerg/cache-query-job-benchmark
  • bst-1 protected
  • juerg/cache-query-job
  • tristan/fix-recursive-artifact-pull
  • nanonyme/remove-fix-python-timestamps
  • tristan/shell-artifacts
  • bschubert/update-coverage
  • juerg/remote-cache
  • nanonyme/subprocess-devnull
  • tristan/artifact-extensions
  • tpollard/custom-platform-properties
  • juerg/buildbox
  • chandan/update-reqs
  • chandan/moar-runners
  • tpollard/optional-sandbox-properties
  • nanonyme/fix-tests
  • bschubert/standardize-source-tests
  • nanonyme/warn-nofile
  • abderrahim/stage-artifact-scriptelement
  • 1.6.1
  • 1.6.0
  • 1.93.5
  • 1.5.1
  • 1.93.4
  • bst-1.4-branchpoint protected
  • 1.5.0
  • 1.4.3
  • 1.93.3
  • 1.93.2
  • 1.4.2
  • 1.93.1
  • 1.93.0
  • 1.91.3
  • 1.91.2
  • 1.91.1
  • 1.91.0
  • bst-1-branchpoint protected
  • 1.4.1
  • 1.4.0
40 results

_yaml.py

  • Tristan Van Berkom's avatar
    e61e6e50
    _yaml.py: Added `allow_none` parameter to _yaml.node_get() · e61e6e50
    Tristan Van Berkom authored
    This allows specifying whether or not the code believes a None
    value is acceptable if explicitly expressed to be None in the YAML.
    
    A previous patch 3ba544b8 changed
    the behavior to accept None for all values across the board, along
    with allowing explicitly setting the `default_value` to `None` which
    caused the code to be much more readable (this was the main motivation
    of the patch, but it had the side effect of allowing None for everything).
    
    In the majority of cases we load YAML however, it either has a value or
    it is not specified in the YAML, and None is hardly ever acceptable
    to be explicitly specified (it may be in the case you want to override
    something with nothing in the YAML, but it is the edge case).
    
    This had the side effect of causing unexpected crashes where the
    YAML specifies an empty dictionary for instance.
    
    Instead of forcing the caller to handle a possible None value, give
    the choice to the caller if they really want to accept a None value,
    and raise the LoadError otherwise.
    
    This fixes issue #803, which is a crash due to receival of an
    unexpected None value through _yaml.node_get()
    e61e6e50
    History
    _yaml.py: Added `allow_none` parameter to _yaml.node_get()
    Tristan Van Berkom authored
    This allows specifying whether or not the code believes a None
    value is acceptable if explicitly expressed to be None in the YAML.
    
    A previous patch 3ba544b8 changed
    the behavior to accept None for all values across the board, along
    with allowing explicitly setting the `default_value` to `None` which
    caused the code to be much more readable (this was the main motivation
    of the patch, but it had the side effect of allowing None for everything).
    
    In the majority of cases we load YAML however, it either has a value or
    it is not specified in the YAML, and None is hardly ever acceptable
    to be explicitly specified (it may be in the case you want to override
    something with nothing in the YAML, but it is the edge case).
    
    This had the side effect of causing unexpected crashes where the
    YAML specifies an empty dictionary for instance.
    
    Instead of forcing the caller to handle a possible None value, give
    the choice to the caller if they really want to accept a None value,
    and raise the LoadError otherwise.
    
    This fixes issue #803, which is a crash due to receival of an
    unexpected None value through _yaml.node_get()
_yaml.py 39.77 KiB