question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Strings not read correctly?

See original GitHub issue

On my Linux system since recently I have to do the following to use a list of strings:

files = [file.decode('UTF-8') for file in data['/files'][...]]]

This is my system:

h5py    3.1.0
HDF5    1.10.6
Python  3.8.6 | packaged by conda-forge | (default, Nov 27 2020, 19:31:52)
[GCC 9.3.0]
sys.platform    linux
sys.maxsize     9223372036854775807
numpy   1.19.4
cython (built with) 0.29.21
numpy (built against) 1.16.5
HDF5 (built against) 1.10.6

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
takluyvercommented, Dec 1, 2020

The string interfaces changed in 3.0 (release notes). You can use data['/files'].asstr()[...] to read them as str objects - this is essentially a convenient shortcut for the list comprehension you’ve written.

0reactions
tdegeuscommented, Feb 3, 2021

Thanks @aragilar ! Let’s close then.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Not reading a string properly - c++ - Stack Overflow
An easy way to do this in C++ is to put the line into an istringstream then loop while (iss > myint). If...
Read more >
Input String Was Not in a Correct Format: Easy Fixes
Input string was not in a correct format warning mainly occurs when you try to convert a non-numeric string into an int. Read...
Read more >
Python Strings | Python Education - Google Developers
Python has a built-in string class named "str" with many handy features (there is an older module named "string" which you should not...
Read more >
String vector inside structure not read in Matlab R2014b
I have a problem with a .mat file generated with Matlab 2018. Besides other variables, it contains a structure with a string vector...
Read more >
File.ReadAllText Method (System.IO) - Microsoft Learn
Opens a text file, reads all the text in the file into a string, and then closes the file. ... because unrecognized characters...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found