-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
read_fwf/table on py3 has trouble with BytesIO #4785
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
Comments
`gzip` and `bz2` both now return `bytes` rather than `str` in Python 3, so need to check for bytes and decode as necessary.
I don't think your example is due to pandas...I get the same error as you have above just by running the following 2 lines: from io import BytesIO
BytesIO("שלום".encode('cp1252')).read() |
You're right, that's the wrong codepage (Should be cp1255) and the example doesn't trigger that code path anyway. fixed. |
@y-p How would you set up the test case in this issue for Python 2? I'm not sure whether I'm encountering a bug with this in PY2 or just translating this test incorrectly. Doesn't need to work in Python 3...I can definitely figure out how to make a cross-compatible test case if I see the Python 2 version. It would be helpful if it didn't use the unicode literals future import. |
Not sure I follow. It's a bug that manifests only on py3, so reasonably can be tested only on py3. Not so? |
Closed by #4783 |
By another path:
is broken. Note that len(sep)>1 activates the python engine anyway right now.
related #4784
Edit: fixed incorrect encoding and updated error
Edit: Updated examples
The text was updated successfully, but these errors were encountered: