Skip to content

Commit e2054de

Browse files
committed
Decode ip_address to unicode as required by ipaddress
1 parent 0ae0bff commit e2054de

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

maxminddb/reader.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ def get(self, ip_address):
9595
Arguments:
9696
ip_address -- an IP address in the standard string notation
9797
"""
98+
if isinstance(ip_address, bytes):
99+
ip_address = ip_address.decode()
100+
98101
address = ipaddress.ip_address(ip_address)
99102

100103
if address.version == 6 and self._metadata.ip_version == 4:

0 commit comments

Comments
 (0)