osPlanning / omx

Open Matrix (OMX)
https://github.com/osPlanning/omx/wiki
Apache License 2.0
49 stars 18 forks source link

not opening my h5 file :-( "the file is not witable" #5

Closed e-lo closed 11 years ago

e-lo commented 11 years ago

Issue Part 1 : call to pytables to open h5 file is returning an error that it isn't writable (FileModeError) despite there not being any permissions or read-onlyness of the file

Issue Part 2: why are we requiring write file privies if we are opening as read-only?

testTA.py:

import omx,numpy

TEST_FILE = r"testData/sfptam.h5"

myfile = omx.openFile(TEST_FILE, 'r')  

Traceback:

C:\work\omx>python testTA.py
Traceback (most recent call last):
  File "testTA.py", line 5, in <module>
    myfile = omx.openFile(TEST_FILE, 'r')
  File "C:\work\omx\omx\__init__.py", line 21, in openFile
    f.root._v_attrs['omx_version'] = __version__
  File "C:\Python27\Lib\site-packages\tables\attributeset.py", line 526, in __se
titem__
    self.__setattr__(name, value)
  File "C:\Python27\Lib\site-packages\tables\attributeset.py", line 427, in __se
tattr__
    nodeFile._checkWritable()
  File "C:\Python27\Lib\site-packages\tables\file.py", line 1620, in _checkWrita
ble
    raise FileModeError("the file is not writable")
tables.exceptions.FileModeError: the file is not writable
Closing remaining open files: testData/sfptam.h5... done

C:\work\omx>python testTA.py > notwrited.log notwrite.log
billyc commented 11 years ago

Fixed. Stupid oopsie bug.