Gajim throw an error when a user is trying to search for rooms on a muc server.
Versions
- OS: Linux
- GTK+ Version: 3.22.26
- PyGObject Version: 3.26.1
- python-nbxmpp Version: 0.6.3
Traceback
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/idna/core.py", line 263, in alabel
ulabel(label)
File "/usr/lib/python3/dist-packages/idna/core.py", line 299, in ulabel
check_label(label)
File "/usr/lib/python3/dist-packages/idna/core.py", line 253, in check_label
raise InvalidCodepoint('Codepoint {0} at position {1} of {2} not allowed'.format(_unot(cp_value), pos+1, repr(label)))
idna.core.InvalidCodepoint: Codepoint U+0020 at position 1 of ' conference' not allowed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/gajim/common/helpers.py", line 299, in prep
server = idna.encode(server).decode('utf-8')
File "/usr/lib/python3/dist-packages/idna/core.py", line 355, in encode
result.append(alabel(label))
File "/usr/lib/python3/dist-packages/idna/core.py", line 265, in alabel
raise IDNAError('The label {0} is not a valid A-label'.format(label))
idna.core.IDNAError: The label b' conference' is not a valid A-label
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/nbxmpp/dispatcher_nb.py", line 498, in dispatch
handler['func'](session, stanza)
File "/usr/lib/python3/dist-packages/gajim/common/connection_handlers.py", line 1435, in _ErrorCB
stanza=iq_obj))
File "/usr/lib/python3/dist-packages/gajim/common/nec.py", line 74, in push_incoming_event
if event_object.generate():
File "/usr/lib/python3/dist-packages/gajim/common/connection_handlers_events.py", line 700, in generate
self.get_jid_resource(check_fake_jid=True)
File "/usr/lib/python3/dist-packages/gajim/common/connection_handlers_events.py", line 85, in get_jid_resource
self.fjid = helpers.get_full_jid_from_iq(self.stanza)
File "/usr/lib/python3/dist-packages/gajim/common/helpers.py", line 1007, in get_full_jid_from_iq
return parse_jid(str(iq_obj.getFrom()))
File "/usr/lib/python3/dist-packages/gajim/common/helpers.py", line 213, in parse_jid
return prep(*decompose_jid(jidstring))
File "/usr/lib/python3/dist-packages/gajim/common/helpers.py", line 304, in prep
raise InvalidFormat(_('Invalid character in hostname.'))
gajim.common.helpers.InvalidFormat: Niepoprawna litera w nazwie hosta.
Steps to reproduce the problem
- Gajim --> Accounts --> Join to a room
- Type: conference.domain.tld with a space at the begining: " conference.domain.tld"
- Search the rooms of this server
Expected behavior
Gajim should prepare jid (in this case trim space from the begining) before it will use it as conference server and show result window.
Actual behavior
Gajim throw an error.