diff -r 6c5245427ccb Lib/distutils/command/sdist.py --- a/Lib/distutils/command/sdist.py Fri Apr 15 17:55:36 2011 -0700 +++ b/Lib/distutils/command/sdist.py Sun Apr 17 23:33:01 2011 +0800 @@ -363,6 +363,10 @@ content = self.filelist.files[:] content.insert(0, '# file GENERATED by distutils, do NOT edit') + index = 0 + for line in content: + content[index] = line.replace('\\','/') + index = index + 1 self.execute(file_util.write_file, (self.manifest, content), "writing manifest file '%s'" % self.manifest) diff -r 6c5245427ccb Lib/distutils/tests/test_sdist.py --- a/Lib/distutils/tests/test_sdist.py Fri Apr 15 17:55:36 2011 -0700 +++ b/Lib/distutils/tests/test_sdist.py Sun Apr 17 23:33:01 2011 +0800 @@ -233,7 +233,10 @@ f = open(join(self.tmp_dir, 'MANIFEST')) try: manifest = f.read() - self.assertEqual(manifest, MANIFEST % {'sep': os.sep}) + if sys.platform == 'win32': + self.assertEqual(manifest, MANIFEST % {'sep': '/'}) + else: + self.assertEqual(manifest, MANIFEST % {'sep': os.sep}) finally: f.close() @@ -419,6 +422,24 @@ f.close() self.assertEqual(manifest, ['README.manual']) + + def test_manifest_sep(self): + # http://bugs.python.org/issue828450 + # check if every file path line in MANIFEST takes '/' as path separator + # thus Unix can read MANIFEST file generated by Windows without any problem + + dist, cmd = self.get_cmd() + cmd.ensure_finalized() + cmd.run() + + f = open(cmd.manifest) + try: + manifest = [line.strip() for line in f.read().split('\n') + if line.strip() != ''] + for line in manifest: + self.assertNotIn('\\', line) + finally: + f.close() def test_suite(): return unittest.makeSuite(SDistTestCase)