Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Dotted keys read from YAML are lost with box_dots / default_box

Open
#305 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
backend

Research direction

Start by reproducing the ordering-dependent examples with Box.from_yaml using box_dots=True and default_box=True. Inspect the YAML-loading and dotted-key handling paths; done means both key orders retain a.b as nested a.b, with regression coverage for the reported inputs.

Written by the indexing model from the issue text.

Description

When reading the following YAML file...

a.b: c
a:
  d: e

... with box_dots=True and default_box=True, the key a.b is lost when it's in front of a:

>>> import box
>>> box.Box.from_yaml(filename='test.yml')
Box({'a.b': 'c', 'a': {'d': 'e'}})
>>> box.Box.from_yaml(filename='test.yml',box_dots=True,default_box=True)
Box({'a': {'d': 'e'}})

Having the keys in reverse works correctly:

>>> box.Box.from_yaml(filename='test_reverse.yml')
Box({'a': {'d': 'e'}, 'a.b': 'c'})
>>> box.Box.from_yaml(filename='test_reverse.yml',box_dots=True,default_box=True)
Box({'a': {'d': 'e', 'b': 'c'}})
Dominant language
Python
Stars
2.8k
Forks
138
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cdgriffith/Box

All issues in cdgriffith/Box

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.