Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache interface does not work with dict semantics #69

Open
rraval opened this issue Nov 10, 2014 · 0 comments
Open

Cache interface does not work with dict semantics #69

rraval opened this issue Nov 10, 2014 · 0 comments

Comments

@rraval
Copy link

rraval commented Nov 10, 2014

When mail_exchanger_lookup() fails to connect to the mail exchanger for a specific domain, it sets the corresponding cache entry to False (line 149). However, lookup_exchanger_in_cache() looks for the string 'False' to figure out if there was an MX connection failure for a domain in cache.

This asymmetry means that caches that implement proper dict semantics (i.e. not coercing all values to strings unlike the Redis driver) fail miserably. I believe that a simple in memory cache like defaultdict(lambda: None) should just work and not fail with TypeError. This behaviour is also the root cause for #31.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant