diff --git a/Bugtracker/__init__.py b/Bugtracker/__init__.py index ffc4bd4..87d8544 100644 --- a/Bugtracker/__init__.py +++ b/Bugtracker/__init__.py @@ -24,7 +24,7 @@ import supybot.world as world from imp import reload -__version__ = "3.3.0" +__version__ = "3.4.0" __author__ = supybot.Author("Krytarik Raido", "krytarik", "krytarik@tuxgarage.com") __contributors__ = { supybot.Author("Dennis Kaarsemaker", "Seveas", "dennis@kaarsemaker.net"): ['Original Author'], diff --git a/Bugtracker/plugin.py b/Bugtracker/plugin.py index 91da429..f11b60f 100644 --- a/Bugtracker/plugin.py +++ b/Bugtracker/plugin.py @@ -1002,25 +1002,29 @@ class Trac(IBugtracker): if 'HTTP Error 500' in str(e): raise BugNotFoundError raise BugtrackerError(self.errget % (self.description, e, url)) - raw = raw.replace('\r\n', '\n') - (headers, rest) = raw.split('\n', 1) - headers = headers.strip().split('\t') - rest = rest.strip().split('\t') + try: + raw = raw.replace('\r\n', '\n') + (headers, rest) = raw.split('\n', 1) + headers = headers.strip().split('\t') + rest = rest.strip().split('\t') - title = status = package = severity = assignee = "" - if "summary" in headers: title = rest[headers.index("summary")] - if "status" in headers: status = rest[headers.index("status")] - if "component" in headers: package = rest[headers.index("component")] - if "severity" in headers: - severity = rest[headers.index("severity")] - elif "priority" in headers: - severity = rest[headers.index("priority")] - if "owner" in headers: - assignee = rest[headers.index("owner")] - return (id, package, title, severity, status, assignee, url, [], []) + severity = assignee = "" + if "severity" in headers: + severity = rest[headers.index("severity")] + elif "priority" in headers: + severity = rest[headers.index("priority")] + if "owner" in headers: + assignee = rest[headers.index("owner")] + return (id, package, title, severity, status, assignee, url, [], []) + except Exception as e: + # Due to unreliable matching + if '.' in self.name: + supylog.exception(self.errparse % (self.description, e, url)) + return + raise BugtrackerError(self.errparse % (self.description, e, url)) # Introspection is quite cool defined_bugtrackers = {}