[python-win32] GetVolumeInformation throwing exception

Gustavo Tabares gustavotabares at gmail.com
Wed Jan 10 21:25:52 CET 2007


Hi all,

I'm having a problem with the code below and I'm not sure if there is a bug
in win32api.GetVolumeInformation. There is a simple workaround, but I'm
curious nonetheless. Any help is appreciated.

I'm using Python 2.5 final with pywin32-210.


# F: is a mapped network drive of a Windows XP share
import os
import win32api

win32api.GetVolumeInformation('F:')

os.chdir('F:\\somedir')
print os.getcwd()   # to verify

win32api.GetVolumeInformation('F:')

#########################################

Here is the exception thrown on the last line:

error: (123, 'GetVolumeInformation', 'The filename, directory name, or
volume label syntax is incorrect.')

The simple workaround is to add os.sep to the F: string in the last call to
GetVolumeInformation; it runs properly. This also still breaks if you chdir
back to the local C: drive.


Thanks,
Gustavo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20070110/7e535763/attachment.html 


More information about the Python-win32 mailing list