Skip to content

BUG: handle IndexError: list index out of range for invalid URIs #1

@grimen

Description

@grimen
======================================================================
ERROR: test___str__ (__main__.TestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/grimen/.pyenv/versions/3.8.0/lib/python3.8/site-packages/connection_uri/uri.py", line 336, in deserialize
    'ports': [ports[endpoint_index]],
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "markable_utils/tests/data/storages2/test_mongodb.py", line 1009, in test___str__
    reset(storage)
  File "markable_utils/tests/data/storages2/test_mongodb.py", line 85, in reset
    raise error
  File "markable_utils/tests/data/storages2/test_mongodb.py", line 60, in reset
    client = connect(storage)
  File "markable_utils/tests/data/storages2/test_mongodb.py", line 47, in connect
    raise error
  File "markable_utils/tests/data/storages2/test_mongodb.py", line 36, in connect
    uri_object = connection_uri.unpack(storage.uri)
  File "/Users/grimen/.pyenv/versions/3.8.0/lib/python3.8/site-packages/connection_uri/uri.py", line 418, in unpack
    return uri.unpack(*args, **kwargs)
  File "/Users/grimen/.pyenv/versions/3.8.0/lib/python3.8/site-packages/connection_uri/uri.py", line 364, in unpack
    return self.deserialize(*args, **kwargs)
  File "/Users/grimen/.pyenv/versions/3.8.0/lib/python3.8/site-packages/connection_uri/uri.py", line 356, in deserialize
    raise URIError(error, details = {
connection_uri.uri.URIError: list index out of range - {'data': 'mongodb://localhost:27017{path.sep}{db_key}'}

----------------------------------------------------------------------

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions