From: Alexandre F. <ale...@lo...> - 2006-08-22 19:43:00
|
Hi, I'm running into a weird problem with an application using pytables on Windows XP: tables.openFile refuses to create a file on the Desktop, because 'the directory exists but it cannot be written'. At the same time, I'm able to use the builtin function open() to create a file in the same directory. Here is a sample interactive session ('Bureau' is MS french for 'Desktop'): >>> f =3D open('../../Bureau/toto.txt', 'w') >>> f.write('toto') >>> f.close() >>> import tables >>> hdf =3D tables.openFile('../../Bureau/toto.h5', 'w') Traceback (most recent call last): File "<stdin>", line 1, in ? File "C:\Python24\Lib\site-packages\tables\File.py", line 227, in openFile METADATA_CACHE_SIZE, nodeCacheSize) File "hdf5Extension.pyx", line 580, in hdf5Extension.File.__new__ File "C:\Python24\Lib\site-packages\tables\utils.py", line 587, in checkFileAccess raise IOError("directory ``%s`` exists but it can not be written" IOError: directory ``../../Bureau`` exists but it can not be written >>> import os >>> os.getcwd() 'C:\\Documents and Settings\\alexandre\\dev\\projects' creating an hdf file in the projects directory works fine: >>> hdf =3D tables.openFile('toto.h5', 'w') >>> print hdf toto.h5 (File) '' Last modif.: 'Tue Aug 22 20:38:24 2006' Object Tree: / (RootGroup) '' I'm more of a Linux guy, but the customer gets the final word on the OS. Any hint on what is going on is welcome. Maybe the permission check in openFile() should be changed to a try...except clause?=20 In case it matters, I'm running WinXP SP1, python2.4 and pytables 1.3.2. --=20 Alexandre Fayolle LOGILAB, Paris (France) Formations Python, Zope, Plone, Debian: http://www.logilab.fr/formations D=E9veloppement logiciel sur mesure: http://www.logilab.fr/services Informatique scientifique: http://www.logilab.fr/science |