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

Update for Python 3 (and add Pipfile for pipenv) #12

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

demize
Copy link

@demize demize commented Feb 24, 2023

Had to use this script today, and found it nearly worked with Python 3, but needed a few tweaks. Hunted down the issues, and I'm submitting this PR here so other people can benefit from my trouble :)

  • Added a Pipfile (and Pipfile.lock)
  • Added a .gitignore for the MMDB files
  • Made a few tweaks to resolve various errors:
    • Fix a typo in the instructions for unzipping the ASN MMDB file
    • Open the output CSV in text mode, not binary mode
    • Switch to urllib.request instead of Python 2 urllib
    • Add python-geoip-python3 dependency to resolve errors

Tested this version on the sample data and it looks good, and I made mostly the same tweaks on my work machine and it worked well with real data.

- Fix a typo in the instructions for unzipping the ASN MMDB file
- Open the output CSV in text mode, not binary mode
- Switch to urllib.request instead of Python 2 urllib
- Add `python-geoip-python3` dependency to resolve errors
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.

1 participant