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

Getting a ValueError if called get_location with detailed=True argument on latest SxGeoCity.dat (2013.04.22) #2

Closed
byashimov opened this issue Oct 23, 2013 · 3 comments

Comments

@byashimov
Copy link

from pysyge.pysyge import GeoLocator, MODE_BATCH, MODE_MEMORY
ip = '95.140.92.49'
db = GeoLocator('SxGeoCity.dat', MODE_BATCH | MODE_MEMORY)
# Does stuff
db.get_location(ip)
{'city': '...',}

# Fails
db.get_location(ip, detailed=True)
"""
local/lib/python2.7/site-packages/pysyge/pysyge.pyc in get_location(self, ip, detailed)
    290             location = self._parse_location(seek)
    291             if detailed:
--> 292                 return self._parse_location_details(location)
    293             return location
    294         else:

local/lib/python2.7/site-packages/pysyge/pysyge.pyc in _parse_location_details(self, city)
    253                 region = self._fh.read(self._max_region).split('\0')
    254             city['region'] = region[0]
--> 255             city['tz'] = self._tz[int(region[1])]
    256         else:
    257             city['region'] = ''

ValueError: invalid literal for int() with base 10: ''

"""
@idlesign
Copy link
Owner

Seems already fixed in 0.1.1 (867e795).

@byashimov
Copy link
Author

Oh, I'm sorry then.

@idlesign
Copy link
Owner

Never mind ;)

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

No branches or pull requests

2 participants