Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
534c6e6e
Commit
534c6e6e
authored
Aug 20, 2008
by
Hirokazu Yamamoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport r65900: fixed get_file_system in test_os.py ('path' is unicode on py3k and ansi on trunk)
parent
4df1b6d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
Lib/test/test_os.py
Lib/test/test_os.py
+8
-5
No files found.
Lib/test/test_os.py
View file @
534c6e6e
...
...
@@ -265,12 +265,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"
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment