AttributeError: 'DynamicStrictYAMLLoader' object has no attribute 'comment_handling'
See original GitHub issueI’m suddenly getting the following error on two different projects where I’m loading YAMLs using strictyaml
. Using dependabot on both of them, so they have the latest version: strictyaml==1.4.0
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.9.5/x64/bin/pelican", line 8, in <module>
sys.exit(main())
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/pelican/__init__.py", line 501, in main
pelican, settings = get_instance(args)
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/pelican/__init__.py", line 418, in get_instance
return cls(settings), settings
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/pelican/__init__.py", line 60, in __init__
signals.initialized.send(self)
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/blinker/base.py", line 266, in send
return [(receiver, receiver(sender, **kwargs))
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/blinker/base.py", line 266, in <listcomp>
return [(receiver, receiver(sender, **kwargs))
File "/home/runner/work/honzajavorek.cz/honzajavorek.cz/plugins/home_appearances.py", line 39, in load_appearances
appearances = yaml.load(path.read_text(), SCHEMA).data
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/strictyaml/parser.py", line 318, in load
return generic_load(yaml_string, schema=schema, label=label)
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/strictyaml/parser.py", line 280, in generic_load
document = ruamelyaml.load(yaml_string, Loader=DynamicStrictYAMLLoader)
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/ruamel/yaml/main.py", line 1067, in load
return loader._constructor.get_single_data()
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/ruamel/yaml/constructor.py", line 122, in get_single_data
return self.construct_document(node)
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/ruamel/yaml/constructor.py", line 132, in construct_document
for _dummy in generator:
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/ruamel/yaml/constructor.py", line 1611, in construct_yaml_seq
data.extend(self.construct_rt_sequence(node, data))
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/ruamel/yaml/constructor.py", line 1322, in construct_rt_sequence
if self.loader and self.loader.comment_handling is None:
AttributeError: 'DynamicStrictYAMLLoader' object has no attribute 'comment_handling'
The specific code where this blew up is this:
path = Path('./content/data/appearances.yml')
appearances = yaml.load(path.read_text(), SCHEMA).data
But as I mentioned, this has happened on a different project I maintain, too. I tried to look up the error here or at the PyYAML repo, but no luck. Anyone knows what’s wrong? This code has worked previously and I made no changes to it, I suspect it exploded because of a version upgrade.
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (6 by maintainers)
Top Results From Across the Web
Pybrain: 'Superviseddataset' Object Has No Attribute - ADocLib
I am tying to update existing webservice using new Azure ML package. Its failing with error AttributeError: 'str' object has no attribute. I...
Read more >module 'yaml' has no attribute 'FullLoader' - Stack Overflow
Keep in mind that pip's dependency resolver does not currently take into account all the packages that are installed for a given application....
Read more >[Solved] AttributeError: 'module' object has no attribute
Click here to subscribe - https://www.youtube.com/channel/UCeVMnSShP_Iviwkknt83cww▻Instagram ...
Read more >Error Fixed: 'matplotlib.pyplot' has no attribute 'bar_label'
'matplotlib.pyplot' has no attribute 'bar_label' OR 'AxesSubplot' object has no attribute 'bar_label'In this video we will talk about how to ...
Read more >Why am I getting AttributeError: Object has no attribute?
PYTHON : Why am I getting AttributeError : Object has no attribute ? [ Gift : Animated Search Engine ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There is a temporary fix which downgrades ruamel.yaml to version 0.17.4.
If you upgrade strictyaml to version 1.4.2 it should work.
On Mon, May 31, 2021 at 5:30 PM Colm O’Connor @.***> wrote:
I’m looking at it now.
On Mon, May 31, 2021 at 5:06 PM emagnantfkh @.***> wrote: