Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

OmegaConf is changeing the pyyaml SafeLoader #289

Closed
omry opened this issue Jul 11, 2020 · 0 comments · Fixed by #295
Closed

OmegaConf is changeing the pyyaml SafeLoader #289

omry opened this issue Jul 11, 2020 · 0 comments · Fixed by #295
Labels
bug Something isn't working easy

Comments

@omry
Copy link
Owner

omry commented Jul 11, 2020

Context

Instead of changing the core one, it should return a new one to avoid changing the behavior of pyyaml.

In [2]: import yaml

In [3]: yaml.load("gitrev: 10e10", Loader=yaml.loader.SafeLoader)
Out[3]: {'gitrev': '10e10'}

In [4]: yaml.load("gitrev: 100e100", Loader=yaml.loader.SafeLoader)
Out[4]: {'gitrev': '100e100'}

In [5]: from omegaconf import OmegaConf

In [6]: yaml.load("gitrev: 100e100", Loader=yaml.loader.SafeLoader)
Out[6]: {'gitrev': '100e100'}

In [7]: OmegaConf.create("gitrev: 100e100")
Out[7]: {'gitrev': 1e+102}

In [8]: yaml.load("gitrev: 100e100", Loader=yaml.loader.SafeLoader)
Out[8]: {'gitrev': 1e+102}
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working easy
Projects
None yet
1 participant