Skip to content

Nonexistent database raises FileNotFoundError #42

Closed
@radekholy24

Description

@radekholy24

Can you please take a look at this:

Reproducer

  1. make sure that nonexistent.mmdb does not exist
  2. call geoip2.database.Reader('nonexistent.mmdb')

Actual result

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/tmp/venv/lib/python3.5/site-packages/geoip2/database.py", line 82, in __init__
    self._db_reader = maxminddb.open_database(filename, mode)
  File "/tmp/venv/lib/python3.5/site-packages/maxminddb/__init__.py", line 32, in open_database
    return maxminddb.extension.Reader(database)
FileNotFoundError: No such file or directory: 'nonexistent.mmdb'

Expected result

A ValueError or a change in the documentation.

Versions

geoip2 2.4.2
maxminddb 1.2.3
libmaxminddb-dev 1.0.4-2.1
libmaxminddb0 1.0.4-2.1
Python 3.5.2
Ubuntu 16.04.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions