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

MemcacheServerError byte string message #392

Open
fabtjar opened this issue Apr 5, 2022 · 3 comments
Open

MemcacheServerError byte string message #392

fabtjar opened this issue Apr 5, 2022 · 3 comments

Comments

@fabtjar
Copy link

fabtjar commented Apr 5, 2022

When I attempt to set a cache too big the error message is a byte string for pymemcache.exceptions.MemcacheServerError(b'object too large for cache'). I believe this message is coming from the backend but shouldn't we decode it to a regular string as we raise the exception?

@jogo
Copy link
Contributor

jogo commented Apr 5, 2022

Looking over this codebase this has been the default behavior since 108f15c, and changing it risks breaking existing usage. While I couldn't find any cases where there could be unicode in the error message https://github.com/memcached/memcached/search?p=1&q=SERVER_ERROR&type=code I am inclined to say we should leave the exception as bytes so we don't risk breaking existing usage of MemcacheServerError.

@jparise
Copy link
Collaborator

jparise commented Apr 5, 2022

If we wanted to risk the break, now would be a good time to do it (as part of the upcoming 4.0, Python 3-only release).

@jogo
Copy link
Contributor

jogo commented Apr 5, 2022

I personally bias towards breaking as few things as possible to reduce the toil required to upgrade.

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

3 participants