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

Feature/python3 bytes #65

Conversation

johnchristopherjones
Copy link

This change attempts to resolve #60 by proposing using bytes as the Python 3 interface.

Beanstalkd does not explicitly enforce any encoding.  It's a byte protocol
whose commands happen to be readable as ASCII/UTF-8.  To match this behavior
in Python 3 without breaking bidirectional transparency, bytes should
be used instead of strings.

This change makes the use of bytes explicit, addressing earl#60.

Note that bytes are usually inconvenient, so a convenience layer for strings
should be added.  This change merely makes the original Python 2
implementation's assumption of bytes explicit and correct.

This change obviates the need to deal with encoding.

Beanstalkd does implicitly encourage UTF-8 because it yields some data in
YAML.  PyYAML, which beanstalkc uses if available, additionally allows
UTF-16-LE and UTF-16-BE.  If a default encoding is chosen for the
convenience layer, it should probably be UTF-8.
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

Successfully merging this pull request may close these issues.

8-bit transparency under Python 3
1 participant