22import unittest
33from collections import UserDict
44from test .support import import_helper
5- from test .support .os_helper import unlink , TESTFN , TESTFN_UNDECODABLE
5+ from test .support .os_helper import unlink , TESTFN , TESTFN_ASCII , TESTFN_UNDECODABLE
66
77NULL = None
88_testcapi = import_helper .import_module ('_testcapi' )
@@ -35,6 +35,7 @@ class CAPITest(unittest.TestCase):
3535
3636 def test_run_stringflags (self ):
3737 # Test PyRun_StringFlags().
38+ # XXX: fopen() uses different path encoding than Python on Windows.
3839 def run (s , * args ):
3940 return _testcapi .run_stringflags (s , Py_file_input , * args )
4041 source = b'a\n '
@@ -63,7 +64,7 @@ def run(s, *args):
6364
6465 def test_run_fileexflags (self ):
6566 # Test PyRun_FileExFlags().
66- filename = os .fsencode (TESTFN )
67+ filename = os .fsencode (TESTFN if os . name != 'nt' else TESTFN_ASCII )
6768 with open (filename , 'wb' ) as fp :
6869 fp .write (b'a\n ' )
6970 self .addCleanup (unlink , filename )
@@ -89,6 +90,7 @@ def run(*args):
8990 # CRASHES run(UserDict(), dict(a=1))
9091
9192 @unittest .skipUnless (TESTFN_UNDECODABLE , 'only works if there are undecodable paths' )
93+ @unittest .skipIf (os .name == 'nt' , 'does not work on Windows' )
9294 def test_run_fileexflags_with_undecodable_filename (self ):
9395 run = _testcapi .run_fileexflags
9496 try :
0 commit comments