Opened 5 years ago
Closed 3 years ago
#3271 closed bug (Fixed)
Support pygeoip for ip lookups
Reported by: | Calum | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 2.0.6 |
Component: | Core | Version: | 2.0.0 |
Keywords: | Cc: |
Description (last modified by )
Alpine linux only packages the pure-python pygeoip as py3-geoip
which is not the same as the MaxMind GeoIP (python3-geoip
on Ubuntu).
However they packages are compatible with some minor changes:
-
deluge/core/preferencesmanager.py
diff --git deluge/core/preferencesmanager.py deluge/core/preferencesmanager.py index e3c935c99..19dd3b2fb 100644
(this hunk was shorter than expected) 24 24 from deluge._libtorrent import lt 25 25 from deluge.event import ConfigValueChangedEvent 26 26 27 GeoIP = None 27 28 try: 28 import GeoIP29 from GeoIP import GeoIP 29 30 except ImportError: 30 GeoIP = None 31 try: 32 from pygeoip import GeoIP 33 except ImportError: 34 pass 31 35 32 36 try: 33 37 from urllib.parse import quote_plus … … def _on_set_geoip_db_location(self, key, geoipdb_path): 464 469 # Load the GeoIP DB for country look-ups if available 465 470 if os.path.exists(geoipdb_path): 466 471 try: 467 self.core.geoip_instance = GeoIP.open( 468 geoipdb_path, GeoIP.GEOIP_STANDARD 469 ) 472 self.core.geoip_instance = GeoIP(geoipdb_path, 0) 470 473 except AttributeError: 471 474 log.warning('GeoIP Unavailable') 472 475 else:
Change History (4)
comment:1 by , 5 years ago
Description: | modified (diff) |
---|
comment:2 by , 3 years ago
Milestone: | 2.0.4 → 2.0.5 |
---|
Note:
See TracTickets
for help on using tickets.
Ticket retargeted after milestone closed