Hello.
Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import notifiers
>>> zulip = notifiers.providers.zulip.Zulip()
>>> zulip.notify(message="msg", email="[email protected]", api_key="abc", subject="test", to="[email protected]", domain="")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\delgan\AppData\Local\Programs\Python\Python36\lib\site-packages\notifiers\core.py", line 272, in notify
data = self._process_data(**kwargs)
File "C:\Users\delgan\AppData\Local\Programs\Python\Python36\lib\site-packages\notifiers\core.py", line 204, in _proces
s_data
data = self._prepare_data(data)
File "C:\Users\delgan\AppData\Local\Programs\Python\Python36\lib\site-packages\notifiers\providers\zulip.py", line 75,
in _prepare_data
base_url = self.base_url.format(domain=data.pop('domain')) if data.get('domain') else data.pop('server')
KeyError: 'server'
I saw this recipe multiple time in the source code. Maybe if key in data
should be used instead?
This is a minor detail (I am not even sure it deserves a fix?), but I'm reporting this in case it causes subtle bugs for providers accepting falsy values like 0
.