secynic / ipwhois

Retrieve and parse whois data for IPv4 and IPv6 addresses
https://ipwhois.readthedocs.io/en/latest
BSD 2-Clause "Simplified" License
556 stars 121 forks source link

iso_3166-1.csv missing in v 1.3.0 ? #333

Open noselasd opened 2 weeks ago

noselasd commented 2 weeks ago

I upgraded from ipwhois 1.2.0 to 1.3.0 and now:


$ ipython
Python 3.12.7 (main, Oct 28 2024, 11:28:41) [GCC 11.2.1 20220127 (Red Hat 11.2.1-9)]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.29.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from ipwhois.utils import get_countries

In [2]: get_countries()
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
Cell In[2], line 1
----> 1 get_countries()

File ~/.virtualenvs/whoistest/lib/python3.12/site-packages/ipwhois/utils.py:246, in get_countries(is_legacy_xml)
    242 log.debug('Opening country code CSV: {0}'.format(
    243         str(data_dir) + '/data/iso_3166-1_list_en.xml'))
    245 # Create the country codes file object.
--> 246 f = io.open(str(data_dir) + '/data/iso_3166-1.csv', 'r',
    247             encoding='utf-8')
    249 # Create csv reader object.
    250 csv_reader = csv.reader(f, delimiter=',', quotechar='"')

FileNotFoundError: [Errno 2] No such file or directory: '/home/noselasd/.virtualenvs/whoistest/lib/python3.12/site-packages/ipwhois/data/iso_3166-1.csv'

In [3]: