Update of /cvsroot/pywin32/pywin32/win32/test
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11009
Modified Files:
test_win32api.py
Log Message:
Use %temp% instead of the cwd so there is more hope of \\\\?\\ semantics.
Index: test_win32api.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/test/test_win32api.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** test_win32api.py 3 Oct 2008 01:03:56 -0000 1.14
--- test_win32api.py 11 Dec 2008 00:21:42 -0000 1.15
***************
*** 5,8 ****
--- 5,9 ----
import win32api, win32con, win32event, winerror
import sys, os
+ import tempfile
class CurrentUserTestCase(unittest.TestCase):
***************
*** 138,145 ****
def testLongLongPathNames(self):
# We need filename where the FQN is > 256 - simplest way is to create a
! # 250 character directory in the cwd.
import win32file
basename = "a" * 250
! fname = "\\\\?\\" + os.path.join(os.getcwd(), basename)
try:
win32file.CreateDirectoryW(fname, None)
--- 139,150 ----
def testLongLongPathNames(self):
# We need filename where the FQN is > 256 - simplest way is to create a
! # 250 character directory in the cwd (except - cwd may be on a drive
! # not supporting \\\\?\\ (eg, network share) - so use temp.
import win32file
basename = "a" * 250
! # but we need to ensure we use the 'long' version of the
! # temp dir for later comparison.
! long_temp_dir = win32api.GetLongPathNameW(tempfile.gettempdir())
! fname = "\\\\?\\" + os.path.join(long_temp_dir, basename)
try:
win32file.CreateDirectoryW(fname, None)
|