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

remove deprecated parameter for YAML loader & dumper #2520

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

sebix
Copy link
Member

@sebix sebix commented Aug 13, 2024

typ='unsafe' is deprecated

fixes #2489

Please don't merge before 3.3.1 release is done.

@sebix sebix added bug Indicates an unexpected problem or unintended behavior component: core labels Aug 13, 2024
@sebix sebix added this to the 3.3.2 Bugfix release milestone Aug 13, 2024
@sebix sebix marked this pull request as draft August 27, 2024 08:39
@sebix
Copy link
Member Author

sebix commented Sep 4, 2024

This does not work for the state.json:

[   44s] Traceback (most recent call last):
[   44s]   File "/usr/bin/intelmqctl", line 33, in <module>
[   44s]     sys.exit(load_entry_point('intelmq==3.3.1', 'console_scripts', 'intelmqctl')())
[   44s]              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[   44s]   File "/usr/lib/python3.11/site-packages/intelmq/bin/intelmqctl.py", line 1302, in main
[   44s]     return x.run()
[   44s]            ^^^^^^^
[   44s]   File "/usr/lib/python3.11/site-packages/intelmq/bin/intelmqctl.py", line 430, in run
[   44s]     retval, results = args.func(**args_dict)
[   44s]                       ^^^^^^^^^^^^^^^^^^^^^^
[   44s]   File "/usr/lib/python3.11/site-packages/intelmq/bin/intelmqctl.py", line 1033, in upgrade_conf
[   44s]     state = utils.load_configuration(state_file)
[   44s]             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[   44s]   File "/usr/lib/python3.11/site-packages/intelmq/lib/utils.py", line 222, in load_configuration
[   44s]     config = YAML(pure=True).load(fpconfig)
[   44s]              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[   44s]   File "/usr/lib/python3.11/site-packages/ruamel/yaml/main.py", line 456, in load
[   44s]     return constructor.get_single_data()
[   44s]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[   44s]   File "/usr/lib/python3.11/site-packages/ruamel/yaml/constructor.py", line 114, in get_single_data
[   44s]     node = self.composer.get_single_node()
[   44s]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[   44s]   File "/usr/lib/python3.11/site-packages/ruamel/yaml/composer.py", line 72, in get_single_node
[   44s]     document = self.compose_document()
[   44s]                ^^^^^^^^^^^^^^^^^^^^^^^
[   44s]   File "/usr/lib/python3.11/site-packages/ruamel/yaml/composer.py", line 94, in compose_document
[   44s]     node = self.compose_node(None, None)
[   44s]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[   44s]   File "/usr/lib/python3.11/site-packages/ruamel/yaml/composer.py", line 130, in compose_node
[   44s]     node = self.compose_mapping_node(anchor)
[   44s]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[   44s]   File "/usr/lib/python3.11/site-packages/ruamel/yaml/composer.py", line 211, in compose_mapping_node
[   44s]     item_value = self.compose_node(node, item_key)
[   44s]                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[   44s]   File "/usr/lib/python3.11/site-packages/ruamel/yaml/composer.py", line 106, in compose_node
[   44s]     if self.parser.check_event(AliasEvent):
[   44s]        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[   44s]   File "/usr/lib/python3.11/site-packages/ruamel/yaml/parser.py", line 141, in check_event
[   44s]     self.current_event = self.state()
[   44s]                          ^^^^^^^^^^^^
[   44s]   File "/usr/lib/python3.11/site-packages/ruamel/yaml/parser.py", line 631, in parse_block_mapping_value
[   44s]     if self.scanner.check_token(ValueToken):
[   44s]        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[   44s]   File "/usr/lib/python3.11/site-packages/ruamel/yaml/scanner.py", line 1735, in check_token
[   44s]     self._gather_comments()
[   44s]   File "/usr/lib/python3.11/site-packages/ruamel/yaml/scanner.py", line 1775, in _gather_comments
[   44s]     self.fetch_more_tokens()
[   44s]   File "/usr/lib/python3.11/site-packages/ruamel/yaml/scanner.py", line 278, in fetch_more_tokens
[   44s]     return self.fetch_value()
[   44s]            ^^^^^^^^^^^^^^^^^^
[   44s]   File "/usr/lib/python3.11/site-packages/ruamel/yaml/scanner.py", line 628, in fetch_value
[   44s]     raise ScannerError(
[   44s] ruamel.yaml.scanner.ScannerError: mapping values are not allowed here
[   44s]   in "/var/lib/intelmq/state.json", line 1, column 29

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Indicates an unexpected problem or unintended behavior component: core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pyyaml PendingDeprecationWarning: you should no longer specify 'unsafe' -> test failure
1 participant