Mark Mc Mahon <mtnbikingm...@gmail.com> added the comment: I looked at the existing patches - and noted that they went closer to how Windows does short files - but still left out some cases.
I believe the latest patch catches all cases. from http://msdn.microsoft.com/en-us/library/aa368590(v=vs.85).aspx Short and long file names must not contain the following characters: slash (/) or (\) question mark (?) vertical bar (|) right angle bracket (>) left angle bracket (<) colon (:) asterisk (*) quotation mark (") In addition, short file names must not contain the following characters: plus sign (+) comma (,) semicolon (;) equals sign (=) left square bracket ([) right square bracket (]) No space is allowed preceding the vertical bar (|) separator for the short file name/long file name syntax. Short file names may not include a space, although a long file name may. A space can exist after the separator only if the long file name of the file name begins with the space. No full-path syntax is allowed. Though I wonder do we really need to check for or replace the first set of characters above - none are allowed in any file name, so if they are there it is probably a error in how the function was called! I also tested speed of re.sub, comprehension ("".join(c for c in ...) and for loops - and for loops were the fasted (for the small set of characters being replaced). I am not patching make_id() - because I have added a patch for that to issue2694. Note - The attached patch will probably not apply cleanly - as it pre-supposes that the patch (http://bugs.python.org/file21408/make_id_fix_and_test.patch) from issue2694 is applied first (especially for the tests) ---------- nosy: +markm Added file: http://bugs.python.org/file21420/msilib.make_short.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue1128> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com