sodri126 / netcdf4-python

Automatically exported from code.google.com/p/netcdf4-python
Other
0 stars 0 forks source link

Tests Failure under Win32 - DataSet.path is not a 'unix' path! #196

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. build from source against netCDF 4.3.0 on Windows
2. install
3. execute test/run_all.py

What is the expected output? What do you see instead?
All tests pass
Most tests fail

What version of the product are you using? On what operating system?
netcdf4-python version: 1.0.5
HDF5 lib version:       1.8.11
netcdf lib version:     4.3.0

Please provide any additional information below.
See attached file which fixes all test failures on win32. They are caused by 
trying to delete open files - which is no allowed by default on win32.
The second patch aligns DataSet.path with the documentation - os.path.join will 
use Win32 path separator and not unix.

Original issue reported on code.google.com by grizzly.nyo on 4 Sep 2013 at 12:43

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the win32 test failure fix - I've committed that to svn HEAD.

I decided to leave the path attribute the same (in the docs it says that path 
is a unix path).  Should not matter since it's never actually used to find a 
file in the filesystem.  Plus, I think it's desirable to have the attribute be 
the same no matter what platform you're on.

Original comment by whitaker.jeffrey@gmail.com on 4 Sep 2013 at 2:45

GoogleCodeExporter commented 9 years ago
In case DataSet.path is not changed to use Windows path separators, please 
consider below patch to fix the following test error:

FAIL: runTest (tst_grps.GroupsTestCase)

testing groups

Traceback (most recent call last): File "test\tst_grps.py", line 74, in runTest assert tree == TREE1 AssertionError

Index: test/tst_grps.py

--- test/tst_grps.py (revision 1280) +++ test/tst_grps.py (working copy) @@ -69,14 +69,14 @@ tree = [f.path] for children in walktree(f): for child in children:

Original comment by cjgoh...@gmail.com on 4 Sep 2013 at 6:46

GoogleCodeExporter commented 9 years ago
Done - thanks.

Original comment by whitaker.jeffrey@gmail.com on 4 Sep 2013 at 6:48

GoogleCodeExporter commented 9 years ago
Just to clarify, the patch forced Dataset.path to always use 'unix' paths, 
regardless of platform.

It seems it's better to have a consistent interface regardless of platforms. 
For example the above test will fail on MacOsX since the seperator is ':' - 
@gabi-PC[C:startups]|3> import macpath
@gabi-PC[C:startups]|4> print macpath.sep
:

Original comment by grizzly.nyo on 5 Sep 2013 at 11:12

GoogleCodeExporter commented 9 years ago
OK - I finally get it.  I've included your posixpath patch and have reverted 
the change to tst_grps.py.

Original comment by whitaker.jeffrey@gmail.com on 5 Sep 2013 at 12:29

GoogleCodeExporter commented 9 years ago

Original comment by whitaker.jeffrey@gmail.com on 26 Feb 2014 at 2:04