Describe the bug
self.message_buffer is a Queue object. In Python, a Queue instance
is always truthy regardless of whether it's empty, so the check
if self.message_buffer: never evaluates to False.
To Reproduce
- Run any config that uses the TwitterInput plugin
- The buffer check on line ~13777 of twitter.py always passes
- get_nowait() is called even on an empty queue, relying on the
Empty exception as control flow rather than an intentional guard
Expected behavior
The code should check if not self.message_buffer.empty(): to
properly guard the get_nowait() call.
System Information (please complete the following information):
- Operating System: [Windows 10]
- Python Version: [e.g. v3.11]