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

silx.gui.data: Make TextFormatter compatible with h5py>=3 #3253

Merged
merged 4 commits into from
Nov 9, 2020

Conversation

t20100
Copy link
Member

@t20100 t20100 commented Nov 6, 2020

First, this PR extends the tools/create_h5_sample.py to create more text datasets to test with.
Then, it makes the TextFormatter work across h5py 2 and 3.
Finally it reverts changes made in PR #3240 about test_textformatter.py to test wht this PR provides.

It looks to work fine in silx view from what I tested with both h5py 2.10 and 3.

closes #3245

@t20100 t20100 added this to the 0.14 milestone Nov 6, 2020
@t20100 t20100 requested a review from vallsv November 6, 2020 16:14
@t20100
Copy link
Member Author

t20100 commented Nov 6, 2020

BTW, there is an issue with fixed length UTF-8 which does not get decoded, but it was already there before this PR.

@vallsv
Copy link
Contributor

vallsv commented Nov 6, 2020

Looks better than the first patch.
But you should still catch decoding exception. You can't expect utf-8.
If it fail you could call __formatSafeAscii.

@t20100
Copy link
Member Author

t20100 commented Nov 9, 2020

Added call of __formatSafeAscii for UnicodeDecodeError.

@vallsv vallsv merged commit e71a696 into silx-kit:master Nov 9, 2020
@t20100 t20100 deleted the fix-h5py3 branch December 7, 2020 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ERROR: a bytes-like object is required, not 'str' (h5py v3.0.0)
2 participants