HomeDevCentral

Read correctly empty configuration file

Description

Read correctly empty configuration file

Summary:
When a configuration file exists but is empty, YAML parser returns None.

This change returns an empty dict to represent the empty configuration.

This fixes the following issue for empty config file:

File "/home/dereckson/dev/python/general/lib64/python3.13/site-packages/mergedictionaries/app/app.py", line 118, in <lambda>
  self.context["config"].get("git", []), self.context["git"]
  ^^^^^^^^^^^^^^^^^^^^^^^^^^

AttributeError: 'NoneType' object has no attribute 'get'

Test Plan:

  • create an empty configuration file
  • merge-dictionaries --extract

Reviewers: dereckson

Reviewed By: dereckson

Differential Revision: https://devcentral.nasqueron.org/D3725

Details

Provenance
derecksonAuthored on Thu, Sep 25, 16:59
derecksonPushed on Thu, Sep 25, 17:01
Reviewer
dereckson
Differential Revision
D3725: Read correctly empty configuration file
Parents
rMDbedba96fa89f: Release v0.3.0
Branches
Unknown
Tags
Unknown