Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

pyyaml PendingDeprecationWarning: you should no longer specify 'unsafe' -> test failure #2489

Open
sebix opened this issue Apr 4, 2024 · 1 comment · May be fixed by #2520
Open

pyyaml PendingDeprecationWarning: you should no longer specify 'unsafe' -> test failure #2489

sebix opened this issue Apr 4, 2024 · 1 comment · May be fixed by #2520
Labels
bug Indicates an unexpected problem or unintended behavior component: core

Comments

@sebix
Copy link
Member

sebix commented Apr 4, 2024

  • python311
  • ruamel.yaml 0.18.6 (with C library)

intelmq.tests.bots.experts.modify.test_expert.TestModifyExpertBot.test_events

[   19s] /home/abuild/rpmbuild/BUILD/intelmq/intelmq/lib/utils.py:222: PendingDeprecationWarning: 
[   19s] you should no longer specify 'unsafe'.
[   19s] For **dumping only** use yaml=YAML(typ='full')
[   19s] 
[   19s]   config = YAML(typ="unsafe", pure=True).load(fpconfig)

This leads to

[   29s] ======================================================================
[   29s] FAIL: test_events (intelmq.tests.bots.experts.modify.test_expert.TestModifyExpertBot.test_events)
[   29s] Test if correct Events have been produced.
[   29s] ----------------------------------------------------------------------
[   29s] Traceback (most recent call last):
[   29s]   File "/home/abuild/rpmbuild/BUILD/intelmq/intelmq/tests/bots/experts/modify/test_expert.py", line 90, in test_events
[   29s]     self.run_bot(iterations=7)
[   29s]   File "/home/abuild/rpmbuild/BUILD/intelmq/intelmq/lib/test.py", line 401, in run_bot
[   29s]     self.assertTrue(fields['message'][-1] in '.:?!',
[   29s] AssertionError: False is not true : Logline '/home/abuild/rpmbuild/BUILD/intelmq/intelmq/lib/utils.py:222: PendingDeprecationWarning: ' does not end with .? or !.
[   29s] 
[   29s] ----------------------------------------------------------------------
@sebix sebix added bug Indicates an unexpected problem or unintended behavior component: core labels Apr 4, 2024
@sebix sebix added this to the 3.3.1 milestone Apr 4, 2024
@sebix
Copy link
Member Author

sebix commented Aug 13, 2024

unsafe was used for backwards compatibility with JSON: 09e1d59 and as an attempt to preserve comments, but didn't work either (#2003).

As a fix for this will have quite some impact and risk, I'm hesitant to include the fix in 3.3.1, let's better postpone it for better testing.

@sebix sebix modified the milestones: 3.3.1, 3.3.2 Bugfix release Aug 13, 2024
sebix added a commit to sebix/intelmq that referenced this issue Aug 13, 2024
@sebix sebix linked a pull request Aug 13, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior component: core
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant