Skip to content

Commit

Permalink
Emergency quickfix in geoip2dat.py - a new field was inserted by Maxm…
Browse files Browse the repository at this point in the history
…ind on CSV files.

Maxmind inserted a new field into the CSV files called "is_anycast", and this broke geoip2dat.py CSV reader. This change occurred around 5 days ago. Emergency insertion of the new field in the list of "fields" of the CSV reader that generates the .dat.gz files so that they can be updated.

I will shield the code so that this type of change will no longer affect us in the future. The new releases of GeoIP2Fast v1.2.2 and GeoIP2Fast v1.1.11 (Legacy) will be published in the next few days.

This did not affect the search. It has only affected the creation of new dat.gz files since 1/19/2024.

https://github.com/rabuchaim/geoip2fast/actions/runs/7589712513/job/20674920387

I will create an SMS alert in the github actions workflow to notify me immediately when an error occurs in the automatic creation of files.
  • Loading branch information
rabuchaim authored Jan 25, 2024
1 parent 7358c61 commit c95f9ac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions geoip2fast-legacy/geoip2fast/geoip2dat.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,9 +558,9 @@ def run(country_dir,asn_dir,output_dir,language="en",with_ipv6=False,source_info
break
else:
try:
LINE = line.split(",")
LINE = line.strip().split(",")
cidr, geoname_id, registered_country_id, represented_country_id, \
is_anonymous_proxy, is_satellite_provider = LINE
is_anonymous_proxy, is_satellite_provider,is_anycast = LINE
if is_IPV6:
CIDRInfo = CIDRv6Detail(cidr)
else:
Expand Down Expand Up @@ -787,4 +787,4 @@ def main_function():
sys.exit(run(args.country_dir,args.asn_dir,args.output_dir,args.language,args.withipv6,args.sourceinfo))

if __name__ == "__main__":
sys.exit(main_function())
sys.exit(main_function())

0 comments on commit c95f9ac

Please sign in to comment.