diff -r cccacbfa6eb7 Lib/distutils/tests/test_sdist.py --- a/Lib/distutils/tests/test_sdist.py Sun Apr 24 22:17:32 2011 +0800 +++ b/Lib/distutils/tests/test_sdist.py Sun Apr 24 22:51:46 2011 +0800 @@ -47,13 +47,13 @@ README inroot.txt setup.py -data%(sep)sdata.dt -scripts%(sep)sscript.py -some%(sep)sfile.txt -some%(sep)sother_file.txt -somecode%(sep)s__init__.py -somecode%(sep)sdoc.dat -somecode%(sep)sdoc.txt +data/data.dt +scripts/script.py +some/file.txt +some/other_file.txt +somecode/__init__.py +somecode/doc.dat +somecode/doc.txt """ class SDistTestCase(PyPIRCCommandTestCase): @@ -233,7 +233,7 @@ f = open(join(self.tmp_dir, 'MANIFEST')) try: manifest = f.read() - self.assertEqual(manifest, MANIFEST % {'sep': '/'}) + self.assertEqual(manifest, MANIFEST) finally: f.close() @@ -430,20 +430,20 @@ cmd.ensure_finalized() cmd.run() - f = open(cmd.manifest) + # always use slash character ('/') as separator MANIFEST_STR = """\ # file GENERATED by distutils, do NOT edit README setup.py - somecode%(sep)s__init__.py + somecode/__init__.py """ + + f = open(cmd.manifest) try: manifest = [line.strip() for line in f.read().split('\n') if line.strip() != ''] - # always use slash character ('/') as separator - manifest_slash = [line.strip() for line in - (MANIFEST_STR % {'sep': '/'}).split('\n') + manifest_slash = [line.strip() for line in MANIFEST_STR.split('\n') if line.strip() != ''] self.assertEqual(manifest, manifest_slash) finally: @@ -458,16 +458,19 @@ cmd.ensure_finalized() # cmd will run later, thus know what different thing happens - f = open(cmd.manifest,'w')#now, MANIFEST file is empty or not created MANIFEST_STR = """\ README setup.py - somecode%(sep)s__init__.py - """ + somecode/__init__.py + """ + + f = open(join(self.tmp_dir, 'MANIFEST'), 'w') try: - f.write(MANIFEST_STR % {'sep': '/'}) - filelist = [line.strip() for line in (MANIFEST_STR % {'sep': '/'})\ - .split('\n') if line.strip() !=''] + # using a more easy way to test: directly write the string into + # the MANIFEST file instead creating files + f.write(MANIFEST_STR) + filelist = [line.strip() for line in MANIFEST_STR.split('\n') + if line.strip() !=''] os.sep = '\\' cmd.run()# cmd run now filelist_generated = [line.strip().replace('\\','/') for line in \