Skip to content

Conversation

@SnoopJ
Copy link
Contributor

@SnoopJ SnoopJ commented Jun 13, 2023

Description

This PR fixes an edge-case in url and safety when the result of urlparse has a hostname of None

19:20 <+dgw> https://?bonk
19:20 <+Sopel> Unexpected AttributeError ('NoneType' object has no attribute 'lower') from dgw at 2023-06-13 23:20:54.685361+00:00. Message was: https://?bonk
19:20 <+Sopel> Unexpected AttributeError ('NoneType' object has no attribute 'lower') from dgw at 2023-06-13 23:20:54.705164+00:00. Message was: https://?bonk

Checklist

  • I have read CONTRIBUTING.md
  • I can and do license this contribution under the EFLv2
  • No issues are reported by make qa (runs make quality and make test)
    • This also doesn't seem to introduce any new failure to mypy over Sopel's codebase
  • I have tested the functionality of the things this change touches

@SnoopJ SnoopJ requested a review from a team June 13, 2023 23:07
@dgw dgw changed the title url: skip over URL candidates with empty hostnames safety, url: skip handling invalid links with empty hostnames Jun 13, 2023
@dgw dgw added this to the 8.0.0 milestone Jun 13, 2023
@dgw dgw added the Bugfix Generally, PRs that reference (and fix) one or more issue(s) label Jun 13, 2023
Copy link
Member

@dgw dgw left a comment

Choose a reason for hiding this comment

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

Good lesson that even using a type-checker isn't some magic wand that catches all logic errors.

@dgw dgw merged commit 5ec9482 into sopel-irc:master Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bugfix Generally, PRs that reference (and fix) one or more issue(s)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants