Skip to content

KeyError when a user joins a channel #5

@scientrollogy

Description

@scientrollogy

Traceback indicates that, at times, a user joining a channel while capitalizing the channel name in their /join command will result in the client shutting down due to an unhandled exception.

Traceback (most recent call last):
  File "d:\shared\python\bot\lib\site-packages\fredirc\client.py", line 500, in data_received
    self._processor.process(message)
  File "d:\shared\python\bot\lib\site-packages\fredirc\processor.py", line 67, in process
    self._process_join(prefix, params)
  File "d:\shared\python\bot\lib\site-packages\fredirc\processor.py", line 162, in _process_join
    self._state.channels[channel]._add_nicks(nick)
KeyError: '#Channelname'

I'm very new to programming and python, so I'm not sure why this is happening. Will changing channel = params[0] to channel = params[0].lower() fix this reliably, or is there something else I should be looking at? If it helps, the FredIRC client's /joins are all lowercase #channels.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions