question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Regression due to ruamel.yaml

See original GitHub issue

Potentially dangerous regression in config box, due to the new ruamel.yaml dependency.

>>> from box import ConfigBox
>>> b = ConfigBox.from_yaml("kill_all_humans_mode: no")
>>> if b.kill_all_humans_mode: 
...     print("ok, killing all humans...") 
...
ok, killing all humans...

Same problem with box.Box. Our test suite caught this, but others might not be so lucky. ruamel isn’t exactly a drop-in replacement for yaml, despite claims to the contrary (ruamel defaults to spec 1.2 and yaml is spec 1.1).

I would advise to make the toml and ruamel.yaml dependencies optional (or “soft” dependencies, like it was in 3.x) since users might prefer other providers such as pytoml and PyYAML and you don’t want to tie their hands here.

Personally, I can not use box>=4 at all because the ruamel.yaml has an insane installer which, for various reasons, does not work in the prod environment at $EMPLOYER.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
cdgriffithcommented, Jul 12, 2020

As an update to this, Box 5.0 will go back to being able to be pure python, and installing additional extras as requested. https://github.com/cdgriffith/Box/wiki/Installation

Read more comments on GitHub >

github_iconTop Results From Across the Web

ruamel.yaml / Tickets / #390 Roundtripping regression
I have a test case which has been passing for quite some time but has broken with ruamel.yaml 0.17.10. This test case basically...
Read more >
How can I dump changes corresponding to list using ruamel ...
If I make chnages on a list , ruamel.yaml is able to make changes on the local variable, but it does not dump/write...
Read more >
Departure from previous API - ruamel.yaml - Read the Docs
With version 0.15.0 ruamel.yaml starts to depart from the previous (PyYAML) way of loading and dumping. During a transition period the original load()...
Read more >
ruamel.yaml 0.15.71 - PyPI
ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order.
Read more >
lib_openshift ensure python-ruamel-yaml package is on target ...
Summary: [IntService_public_324] TASK [lib_openshift : lib_openshift ensure python-rua... Keywords: Regression.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found