Skip to content

Commit

Permalink
coretasks: _send_who() hotfix
Browse files Browse the repository at this point in the history
Both I and the reviewer missed a bug in #2383 that passed arguments to
`str.join()` wrong. Switched to `str.format()` at another maintainer's
suggestion.

Co-authored-by: SnoopJ <snoopjedi@gmail.com>
  • Loading branch information
dgw and SnoopJ committed Dec 29, 2022
1 parent 9965cce commit 0b5fb8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sopel/coretasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ def _send_who(bot, channel):
# that it has the requested format. WHO replies with different
# querytypes in the response were initiated elsewhere and will be
# ignored.
bot.write(['WHO', channel, ','.join(WHOX_QUERY, WHOX_QUERYTYPE)])
bot.write(['WHO', channel, '{},{}'.format(WHOX_QUERY, WHOX_QUERYTYPE)])
else:
# We might be on an old network, but we still care about keeping our
# user list updated
Expand Down

1 comment on commit 0b5fb8a

@dgw
Copy link
Member Author

@dgw dgw commented on 0b5fb8a Dec 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error (from testing #2388) that prompted this hotfix:

[2022-12-29 15:03:04,442] sopel.bot            ERROR    - Unexpected TypeError (join() takes exactly one argument (2 given)) from testibot at 2022-12-29 20:03:04.442485. Message was: Sopel: https://sopel.chat/
Traceback (most recent call last):
  File "/home/snoopjedi/repos/sopel-src/sopel/bot.py", line 648, in call_rule
    rule.execute(sopel, trigger)
  File "/home/snoopjedi/repos/sopel-src/sopel/plugins/rules.py", line 1203, in execute
    exit_code = self._handler(bot, trigger)
  File "/home/snoopjedi/repos/sopel-src/sopel/coretasks.py", line 860, in track_join
    _send_who(bot, channel)
  File "/home/snoopjedi/repos/sopel-src/sopel/coretasks.py", line 793, in _send_who
    bot.write(['WHO', channel, ','.join(WHOX_QUERY, WHOX_QUERYTYPE)])
TypeError: join() takes exactly one argument (2 given)

Please sign in to comment.