Skip to content

Skip IPv6 ranges in geo files instead of crashing at startup - #3

Merged
xbit44 merged 1 commit into
xbit44:mainfrom
Snowblind350:geo-skip-ipv6
Oct 13, 2026
Merged

xbit44 merged 1 commit into
xbit44:mainfrom
Snowblind350:geo-skip-ipv6

Conversation

@Snowblind350

Copy link
Copy Markdown
Contributor

If a file in geo/ has an IPv6 line, BotGate exits at startup with:

OverflowError: Python int too large to convert to C unsigned long

load_geo_file stores the ranges in array('L') and an IPv6 address doesn't fit. The listeners only bind IPv4, so this skips IPv6 ranges and logs one warning per file. The IP2Location page the docs point to can generate IPv6 lists, so it's an easy file to end up with.

I added tests/test_geo.py, which fails without the change. The full suite passes here.

Thanks for BotGate.

@xbit44
xbit44 merged commit ea8db2c into xbit44:main Oct 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants