Skip to content

add unicode tests#153

Closed
escapewindow wants to merge 2 commits intoSecurityInnovation:masterfrom
escapewindow:unicode
Closed

add unicode tests#153
escapewindow wants to merge 2 commits intoSecurityInnovation:masterfrom
escapewindow:unicode

Conversation

@escapewindow
Copy link
Copy Markdown

This PR doesn't fix the issue, but it highlights the issue.

In py3, if a unicode string with special characters, e.g. "Hello \U0001F4A9!", is passed through PGPMessage.new(), it results in a munged string that cannot be decoded again.

The bug is somewhere in PGPObject.text_to_bytes. I haven't tracked it down yet.

The current workaround is to encode the unicode string into a bytearray before passing it to PGPMessage.new(), since text_to_bytes passes bytearrays through: https://github.com/SecurityInnovation/PGPy/blob/master/pgpy/types.py#L230

These tests work in py27, but are broken in py35 until text_to_bytes is fixed.

@escapewindow
Copy link
Copy Markdown
Author

More discussion in #154.

@Commod0re Commod0re added the bug label Feb 25, 2016
@Commod0re Commod0re added this to the 0.4.0 milestone Feb 25, 2016
@Commod0re Commod0re self-assigned this Feb 25, 2016
@Commod0re Commod0re added testing and removed bug labels Feb 25, 2016
@Commod0re Commod0re closed this Feb 27, 2016
Commod0re added a commit that referenced this pull request Feb 27, 2016
 - added additional unicode tests - #153
 - fixed mixin/base class ordering of PGPObject subclasses
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants