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

Fix/py2 stringio #118

Merged
merged 2 commits into from
Nov 26, 2021
Merged

Fix/py2 stringio #118

merged 2 commits into from
Nov 26, 2021

Conversation

sanjayankur31
Copy link
Contributor

No description provided.

This reverts commit aa025c6.
In python 2, we must use `from StringIO import StringIO` for strings.
This is not the same as `from io import StringIO` in Python2 (or in
Python3).

The former handles strings, the latter handles unicode. For Py2, since
we're not prefixing all strings with `u""` to make them unicode, we need
to use the first one.

So, different `StringIO` classes need to be imported for Python2 and
Python3. The same `from io import StringIO` cannot be shared.

- https://docs.python.org/2.7/library/stringio.html?highlight=stringio#StringIO.StringIO
- https://docs.python.org/2.7/library/io.html?highlight=io%20stringio#io.StringIO
@sanjayankur31 sanjayankur31 added the T: bug Type: bug label Nov 26, 2021
@sanjayankur31 sanjayankur31 merged commit 04a359a into development Nov 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: bug Type: bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant