Skip to content

Fix a regression supporting Unicode in Python 2#41

Merged
kirsle merged 1 commit intomasterfrom
bug/40-unicode
Aug 9, 2016
Merged

Fix a regression supporting Unicode in Python 2#41
kirsle merged 1 commit intomasterfrom
bug/40-unicode

Conversation

@kirsle
Copy link
Copy Markdown
Member

@kirsle kirsle commented Aug 9, 2016

After reorganizing the code in #30, some of the new Python modules stopped importing unicode_literals which broke cases where Unicode strings were interpolated into quoted strings.

Additionally, the interactive mode needed to decode the user's input message only for Python 2 because it was an ASCII string by default when it needed to be Unicode. Under Python 3 the string is already Unicode.

This also adds a unit test that put a Unicode message into a user variable via <set>/<get> tags which verifies that this change fixed it under Python 2, where the new unit test initially failed.

@kirsle
Copy link
Copy Markdown
Member Author

kirsle commented Aug 9, 2016

This fixes #40

@kirsle kirsle merged commit 33e5a72 into master Aug 9, 2016
@kirsle kirsle deleted the bug/40-unicode branch August 9, 2016 18:12
deldesir added a commit to deldesir/rivescript-python that referenced this pull request Mar 21, 2026
Fix a regression supporting Unicode in Python 2
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.

1 participant