certtools / intelmq

IntelMQ is a solution for IT security teams for collecting and processing security feeds using a message queuing protocol.
https://docs.intelmq.org/latest/
GNU Affero General Public License v3.0
972 stars 295 forks source link

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

Open sebix opened 6 months ago

sebix commented 6 months ago

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 commented 1 month ago

unsafe was used for backwards compatibility with JSON: 09e1d594ea 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.