canonicalizing the file name used for the MD5 checksum so it always
looks like it's a Windows path (i.e., uses \ separators).
git-svn-id: http://scons.tigris.org/svn/scons/trunk@3919
fdb21ef1-2011-0410-befe-
b5e4ea1792b1
import base64
import hashlib
-import os.path
+import ntpath
+import os
import pickle
import re
import string
the project. It basically just needs to be unique, and not
change with each invocation."""
m = hashlib.md5()
- m.update(str(slnfile) + str(name))
+ # Normalize the slnfile path to a Windows path (\ separators) so
+ # the generated file has a consistent GUID even if we generate
+ # it on a non-Windows platform.
+ m.update(ntpath.normpath(str(slnfile)) + str(name))
# TODO(1.5)
#solution = m.hexdigest().upper()
solution = string.upper(_hexdigest(m.digest()))