diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2011-03-27 20:58:52 +0200 |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2011-03-27 20:58:52 +0200 |
commit | a23389f892103301a7076b84742057a1bc9d4886 (patch) | |
tree | ccf39fa06ef88cb9459566dcacc30330d410d4d3 /Lib/msilib | |
parent | e5b3424521b52d1fa0b5b21310a5b2f9871859db (diff) | |
download | cpython-a23389f892103301a7076b84742057a1bc9d4886.tar.gz |
Closes #11696: Fix ID generation in msilib.
Patch by Mark Mc Mahon.
Diffstat (limited to 'Lib/msilib')
-rw-r--r-- | Lib/msilib/__init__.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/msilib/__init__.py b/Lib/msilib/__init__.py index d7a31c0b62..63f392359b 100644 --- a/Lib/msilib/__init__.py +++ b/Lib/msilib/__init__.py @@ -173,9 +173,8 @@ def add_tables(db, module): add_data(db, table, getattr(module, table)) def make_id(str): - #str = str.replace(".", "_") # colons are allowed - for c in " -+~;": - str = str.replace(c, "_") + identifier_chars = string.ascii_letters + string.digits + "._" + str = "".join([c if c in identifier_chars else "_" for c in str]) if str[0] in (string.digits + "."): str = "_" + str assert re.match("^[A-Za-z_][A-Za-z0-9_.]*$", str), "FILE"+str |