Skip to content

Commit 7f71e6a

Browse files
authored
Merge pull request #2556 from sebix/fix-2555
fix: mail url collector: import requests Timeout exception
2 parents d3160ce + f69f68a commit 7f71e6a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
- `intelmq.bots.collectors.shadowserver.collector_reports_api.py`:
2424
- Fixed behaviour if parameter `types` value is empty string, behave the same way as not set, not like no type.
2525
- `intelmq.bots.collectors.misp`: Use `PyMISP` class instead of deprecated `ExpandedPyMISP` (PR#2532 by Radek Vyhnal)
26+
- `intelmq.bots.collectors.mail.collector_mail_url`: Fix import for Timeout exception preventing another exception (fixes #2555, PR#2556 by Sebastian Wagner).
2627

2728
#### Parsers
2829
- `intelmq.bots.parsers.shadowserver._config`:

intelmq/bots/collectors/mail/collector_mail_url.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"""
99
import io
1010
import re
11+
from requests.exceptions import Timeout
1112

1213
from intelmq.lib.mixins import HttpMixin
1314
from intelmq.lib.splitreports import generate_reports
@@ -50,7 +51,7 @@ def process_message(self, uid, message):
5051
self.logger.info("Downloading report from %r.", url)
5152
try:
5253
resp = self.http_get(url)
53-
except requests.exceptions.Timeout:
54+
except Timeout:
5455
self.logger.error("Request timed out %i times in a row." %
5556
self.http_timeout_max_tries)
5657
erroneous = True

0 commit comments

Comments
 (0)