From c95f9ac1ad9a04cf0a7a6d222b70bb2b5abde8ef Mon Sep 17 00:00:00 2001 From: Ricardo Abuchaim <43393040+rabuchaim@users.noreply.github.com> Date: Thu, 25 Jan 2024 01:10:32 -0300 Subject: [PATCH] Emergency quickfix in geoip2dat.py - a new field was inserted by Maxmind 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. --- geoip2fast-legacy/geoip2fast/geoip2dat.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/geoip2fast-legacy/geoip2fast/geoip2dat.py b/geoip2fast-legacy/geoip2fast/geoip2dat.py index cc8228c..3d3cf8c 100755 --- a/geoip2fast-legacy/geoip2fast/geoip2dat.py +++ b/geoip2fast-legacy/geoip2fast/geoip2dat.py @@ -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: @@ -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()) \ No newline at end of file + sys.exit(main_function())