Inconsistent return value in FanoutCache when requesting expire_time · Issue #354 · grantjenks/python-diskcache · GitHub
Skip to content

Inconsistent return value in FanoutCache when requesting expire_time #354

Description

@sevdog

When using FanoutCache.get if a timeout or a sqlite error occurs it only returns the provided default which is inconsistent with the documented behaviour when providing expire_time=True:

if True, return expire_time in tuple

This may lead to unexcpeted errors like "cannot unpack non-iterable NoneType object". The problem is that the expire_time parameter is only handled in ther underlaying cache and not in the except branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions