[Question] version validate should be more strict?
See original GitHub issueTo assist reproducing bugs, please include the following:
Summary of the h5py configuration
---------------------------------
h5py 2.10.0
HDF5 1.10.6
Python 3.6.8 (default, Jan 14 2019, 11:02:34)
[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]]
sys.platform linux
sys.maxsize 9223372036854775807
numpy 1.18.0
when we run python setup.py configure --hdf5-version=X.Y.Z
, we should be a little more strict with the version string, thus to say, the version number should be non-negtive:
https://github.com/h5py/h5py/blob/2caa3d8d5a221b47aa654db2adabe4417634e5cb/setup_configure.py#L42-L49
I think maybe we can change it like this:
def validate_version(s):
""" Ensure that s contains an X.Y.Z format version string, or ValueError.
"""
try:
tpl = tuple(int(x) for x in s.split('.'))
for e in tpl:
if len(tpl) != 3 or e < 0: raise ValueError
except Exception:
raise ValueError("HDF5 version string must be in X.Y.Z format")
@takluyver what do you think?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
The Best Guide to Validation Testing - December Labs
This article will focus on validation testing, covering everything from its ... This is a question that is more common than you may...
Read more >Validating your HTML - W3C Wiki
It uses the XHTML 1.0 Strict doctype as its rule set to validate against. There are a few errors in the document, which...
Read more >Validating a Survey: What It Means, How to do It - mTab
If respondents have responded carefully, their answers to questions that are phrased negatively should be consistent with their answers to similar questions ......
Read more >What is Data Validation? How It Works and Why It's Important
You can compare data values and structure against your defined rules to verify that all the necessary information is within the required quality...
Read more >Permissive vs. Strict API Message validation
Permissive vs. Strict REST API. It seems to me that your question isn't really about REST; similar concerns arise in other messaging systems ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That’s kind of what I’m thinking, but I’m not 100% sure - maybe there’s some scenario I haven’t thought of where it is useful to manually override the auto-detected HDF5 version, or where it can find HDF5 to build but can’t get the version number for some reason.
That could be. I guess that most of us maintaining it are using Linux/Mac, so anything Windows specific may not get much attention.
I also wonder: is it possible to get the HDF5 version number from the header files while compiling? I’m not well up on C stuff, but maybe it’s possible to drop the ctypes version detection thing that way.