Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to yplan geoip packages #107

Merged
merged 1 commit into from
Oct 12, 2023
Merged

Switch to yplan geoip packages #107

merged 1 commit into from
Oct 12, 2023

Conversation

fauxpark
Copy link
Member

Description

Avoids the file collision due to python-geoip and python-geoip-python3 both being installed, and prevents the following stack trace when running on local webstack:

Traceback (most recent call last):
  File "./qmk_compiler.py", line 224, in compile_json
    ip_location = geolite2.lookup(source_ip)
  File "/usr/local/lib/python3.9/dist-packages/geoip.py", line 364, in lookup
    return self._get_actual_db().lookup(ip_addr)
  File "/usr/local/lib/python3.9/dist-packages/geoip.py", line 350, in _get_actual_db
    rv = self._load_database()
  File "/usr/local/lib/python3.9/dist-packages/geoip.py", line 342, in _load_database
    return mod.loader(self, sys.modules[__name__])
  File "/usr/local/lib/python3.9/dist-packages/_geoip_geolite2/__init__.py", line 9, in loader
    return mod.open_database(filename)
  File "/usr/local/lib/python3.9/dist-packages/geoip.py", line 508, in open_database
    md = _read_mmdb_metadata(buf)
  File "/usr/local/lib/python3.9/dist-packages/geoip.py", line 381, in _read_mmdb_metadata
    offset = buf.rfind(MMDB_METADATA_START,
TypeError: a bytes-like object is required, not 'str'

@fauxpark fauxpark added the bug label Oct 12, 2023
@fauxpark fauxpark requested a review from a team October 12, 2023 01:18
@tzarc tzarc merged commit ff4b49d into master Oct 12, 2023
1 check passed
@tzarc tzarc deleted the geoip-yplan branch October 12, 2023 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants