[New-bugs-announce] [issue11696] msilib.make_id() is not safe for non ASCII characters.

Mark Mc Mahon report at bugs.python.org
Sun Mar 27 17:19:09 CEST 2011

New submission from Mark Mc Mahon <mtnbikingmark at gmail.com>:

msilib.make_id() currently ensure that any of the following characters are not in the resulting ID: " -+~;"

Per the Microsoft documentation the following list of characters are allowed.
"""The Identifier data type is a text string. Identifiers may contain the
ASCII characters A-Z (a-z), digits, underscores (_), or periods (.). However, every identifier must begin with either a letter or an underscore."""

If an file name contains any characters outside of the characters " -+~;" + string.ascii_letters + string.digits + "._" then it will be an invalid ID.

This includes many punctuation characters which are valid in file names but not ID's, and every unicode character which does not overlap with ASCII.

The attached patch tries to fix this - and it includes tests.

components: Windows
files: msilib.make_id_fix_and_tests2.patch
keywords: patch
messages: 132336
nosy: markm
priority: normal
severity: normal
status: open
title: msilib.make_id() is not safe for non ASCII characters.
versions: Python 3.2
Added file: http://bugs.python.org/file21430/msilib.make_id_fix_and_tests2.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list