However they packages are compatible with some minor changes:
{{{#!diff
diff --git deluge/core/preferencesmanager.py
deluge/core/preferencesmanager.py
index e3c935c99..19dd3b2fb 100644
--- deluge/core/preferencesmanager.py
+++ deluge/core/preferencesmanager.py
@@ -24,10 +24,15 @@
from deluge._libtorrent import lt
from deluge.event import ConfigValueChangedEvent
+GeoIP = None
try:
- import GeoIP
+ from GeoIP import GeoIP
except ImportError:
- GeoIP = None
+ try:
+ from pygeoip import GeoIP
+ except:
+ ImportError:
+ pass
try:
from urllib.parse import quote_plus
@@ -464,9 +469,7 @@ def _on_set_geoip_db_location(self, key,
geoipdb_path):
# Load the GeoIP DB for country look-ups if available
if os.path.exists(geoipdb_path):
try:
- self.core.geoip_instance = GeoIP.open(
- geoipdb_path, GeoIP.GEOIP_STANDARD
- )
+ self.core.geoip_instance = GeoIP(geoipdb_path, 0)
except AttributeError:
log.warning('GeoIP Unavailable')
else:
}}}
--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3271>
Deluge <https://deluge-torrent.org/>
Deluge Project
Old description:
New description:
Alpine linux only packages the pure-python
[https://pypi.org/project/pygeoip/ pygeoip] as `py3-geoip` which is not
the same as the [https://pypi.org/project/GeoIP/ MaxMind GeoIP]
(`python3-geoip` on Ubuntu).
However they packages are compatible with some minor changes:
{{{#!diff
diff --git deluge/core/preferencesmanager.py
deluge/core/preferencesmanager.py
index e3c935c99..19dd3b2fb 100644
--- deluge/core/preferencesmanager.py
+++ deluge/core/preferencesmanager.py
@@ -24,10 +24,15 @@
from deluge._libtorrent import lt
from deluge.event import ConfigValueChangedEvent
+GeoIP = None
try:
- import GeoIP
+ from GeoIP import GeoIP
except ImportError:
- GeoIP = None
+ try:
+ from pygeoip import GeoIP
+ except ImportError:
+ pass
try:
from urllib.parse import quote_plus
@@ -464,9 +469,7 @@ def _on_set_geoip_db_location(self, key,
geoipdb_path):
# Load the GeoIP DB for country look-ups if available
if os.path.exists(geoipdb_path):
try:
- self.core.geoip_instance = GeoIP.open(
- geoipdb_path, GeoIP.GEOIP_STANDARD
- )
+ self.core.geoip_instance = GeoIP(geoipdb_path, 0)
except AttributeError:
log.warning('GeoIP Unavailable')
else:
}}}
--
--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3271#comment:1>
* status: new => closed
* resolution: => Fixed
Comment:
Fixed by: [65e5010e7fbd]
--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3271#comment:4>