Skip to content
This repository has been archived by the owner on Feb 11, 2019. It is now read-only.

Zoë the Destroyer of ASCII #17

Merged
merged 2 commits into from Jul 13, 2015
Merged

Zoë the Destroyer of ASCII #17

merged 2 commits into from Jul 13, 2015

Conversation

annasborysova
Copy link
Contributor

  • write failing tests
  • make them pass

@annasborysova
Copy link
Contributor Author

@hodgestar @smn

self.assertEqual(node1.getChild('body'), node2.getChild('body'))
#xml1 = node1.toString().replace(node1["id"], id_stub)
#xml2 = node2.toString().replace(node2["id"], id_stub)
#self.assertEqual(xml1, xml2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain why these changes were necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hodgestar The xml string had things like "[ENCODED DATA]" or something.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cause of the [ENCODED DATA] is one of the darker corners of Python 2. In Python 2 once can do u"a" + "b" and the result is roughly the same as u"a" + b.decode(sys.getdefaultencoding()). This means that if we pass any unicode to yowsup, it unexpectedly causes yowsup to internally convert some of its byte strings into unicode strings (which surprises yowsup and results in the [ENCODED DATA] string in the XML).

@hodgestar
Copy link
Contributor

Left one question, otherwise looks awesome. Many woots.

…ed by suddenly discovering that some of its byte strings have become unicode.
@hodgestar
Copy link
Contributor

👍

hodgestar added a commit that referenced this pull request Jul 13, 2015
@hodgestar hodgestar merged commit b50bbbb into develop Jul 13, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants