summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_os.py
diff options
context:
space:
mode:
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2008-08-20 04:13:28 (GMT)
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2008-08-20 04:13:28 (GMT)
commitccfdcd0cb25290d6250e4e4e5a55f3ee1bf31087 (patch)
treec6ead8b81a74185a73ede0cdc847b69585f9af34 /Lib/test/test_os.py
parente6b5ba621f6f9a5463469cbc1873907e43be8bb8 (diff)
downloadcpython-ccfdcd0cb25290d6250e4e4e5a55f3ee1bf31087.zip
cpython-ccfdcd0cb25290d6250e4e4e5a55f3ee1bf31087.tar.gz
cpython-ccfdcd0cb25290d6250e4e4e5a55f3ee1bf31087.tar.bz2
fixed get_file_system in test_os.py ('path' is unicode on py3k and ansi on trunk)
Diffstat (limited to 'Lib/test/test_os.py')
-rw-r--r--Lib/test/test_os.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index b644bdc..5e605d2 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -294,12 +294,15 @@ class StatAttributeTests(unittest.TestCase):
# systems support centiseconds
if sys.platform == 'win32':
def get_file_system(path):
- import os
- root = os.path.splitdrive(os.path.realpath("."))[0] + '\\'
+ root = os.path.splitdrive(os.path.abspath(path))[0] + '\\'
import ctypes
- kernel32 = ctypes.windll.kernel32
- buf = ctypes.create_string_buffer("", 100)
- if kernel32.GetVolumeInformationA(root, None, 0, None, None, None, buf, len(buf)):
+ 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)
+ buf = ctypes.create_unicode_buffer("", 100)
+ if f(root, None, 0, None, None, None, buf, len(buf)):
return buf.value
if get_file_system(test_support.TESTFN) == "NTFS":