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

Refactor to make encoding more consistent #6995

Merged
merged 1 commit into from
Jun 26, 2020

Conversation

AlexandreYang
Copy link
Member

@AlexandreYang AlexandreYang commented Jun 26, 2020

What does this PR do?

  1. Use pymqi.ensure_bytes for better consistency with pymqi own internal use of pymqi.ensure_bytes.

Details:

#6913 (comment)

  1. to_native_string is more appropriate than ensure_unicode.

Currently, in Python2 the code might actually break if there is a unicode in the channel name (unlikely though):

This code fails:

python2 -c 'tag = "abc: {}".format(u"12\xe1")'

Motivation

  • Consistency
  • Use native strings in majority of the code, and convert appropriately at the edge e.g. when interfacing with pymqi that require bytes.

@AlexandreYang AlexandreYang merged commit 71599eb into master Jun 26, 2020
@AlexandreYang AlexandreYang deleted the alex/ibm_mq_encoding_consistency branch June 26, 2020 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants