[Python-3000-checkins] r65918 - python/branches/py3k/Lib/test/test_os.py

hirokazu.yamamoto python-3000-checkins at python.org
Wed Aug 20 18:18:19 CEST 2008


Author: hirokazu.yamamoto
Date: Wed Aug 20 18:18:19 2008
New Revision: 65918

Log:
Reverted r65901 and uses GetVolumeInformationW because string in py3k is unicode.
See http://mail.python.org/pipermail/python-checkins/2008-August/073116.html

Modified:
   python/branches/py3k/Lib/test/test_os.py

Modified: python/branches/py3k/Lib/test/test_os.py
==============================================================================
--- python/branches/py3k/Lib/test/test_os.py	(original)
+++ python/branches/py3k/Lib/test/test_os.py	Wed Aug 20 18:18:19 2008
@@ -301,13 +301,9 @@
         def get_file_system(path):
             root = os.path.splitdrive(os.path.abspath(path))[0] + '\\'
             import ctypes
-            from ctypes.wintypes import LPCWSTR, LPWSTR, DWORD
-            LPDWORD = ctypes.POINTER(DWORD)
-            f = ctypes.windll.kernel32.GetVolumeInformationW
-            f.argtypes = (LPCWSTR, LPWSTR, DWORD,
-                LPDWORD, LPDWORD, LPDWORD, LPWSTR, DWORD)
+            kernel32 = ctypes.windll.kernel32
             buf = ctypes.create_unicode_buffer("", 100)
-            if f(root, None, 0, None, None, None, buf, len(buf)):
+            if kernel32.GetVolumeInformationW(root, None, 0, None, None, None, buf, len(buf)):
                 return buf.value
 
         if get_file_system(support.TESTFN) == "NTFS":


More information about the Python-3000-checkins mailing list