jaraco / jaraco/irc

Empty quit message raises IndexError

Open
#210 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
421
Forks
90
PR merge metrics
No merged PRs in 30d

Description

When a quit message is empty an IndexError is raised as the line is processed.
```
Traceback (most recent call last):
File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
self.run()
File "/usr/lib/python3.9/threading.py", line 892, in run
self._target(*self._args, **self._kwargs)
File "/home/orfeas/DiscIRC-Relay/classcon.py", line 48, in startloop
reactor.process_once(0.2)
File "/home/orfeas/.local/lib/python3.9/site-packages/irc/client.py", line 827, in process_once
self.process_data(in_)
File "/home/orfeas/.local/lib/python3.9/site-packages/irc/client.py", line 792, in process_data
conn.process_data()
File "/home/orfeas/.local/lib/python3.9/site-packages/irc/client.py", line 268, in process_data
self._process_line(line)
File "/home/orfeas/.local/lib/python3.9/site-packages/irc/client.py", line 299, in _process_line
handler(arguments, command, source, tags)
File "/home/orfeas/.local/lib/python3.9/site-packages/irc/client.py", line 348, in _handle_other
arguments = [arguments[0]]
IndexError: list index out of range
```
What solved the issue for me is a try-except block in def _handle_other line 348
```
try:
arguments = [arguments[0]]
except IndexError:
arguments = [""]
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in irc/client.py at _handle_other, where an empty quit message produces the reported IndexError. Reproduce processing an empty quit message and verify that it completes without raising while preserving the message handling behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.