This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author almar
Recipients Garen, John.Cary, abenard, alexis, almar, cgohlke, eric.araujo, eric.smith, koen, loewis, mark.dickinson, mhammond, python-dev, sable, tarek, techtonik
Date 2012-11-21.15:45:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1353512708.41.0.719254709994.issue7833@psf.upfronthosting.co.za>
In-reply-to
Content
Just checking in to point out a possible problem with the code that strips the MSVCR dependency from the embedded manifest. The used regexpr is too greedy: the first bit can trigger on an earlier "assemblyIdentity" tag, so that after the removal the manifest is no longer valid XML. 

The key problem is that the "<assemblyIdentity" and the name attribute are allowed to be on a separate lines. To fix this I removed the re.DOTALL flag and replaced the second occurrence of ".*?" to also allow newlines: 

  pattern = re.compile(
-     r"""<assemblyIdentity.*?name=("|')Microsoft\."""\
-     r"""VC\d{2}\.CRT("|').*?(/>|</assemblyIdentity>)""",
-     re.DOTALL)
+     r"""<assemblyIdentity.*?name=("|')Microsoft\."""\
+     r"""VC\d{2}\.CRT("|')(.|\r|\r)*?(/>|</assemblyIdentity>)""")


It is well possible that the problem does not causes any problems for the intended usage of the code. I'm using the code to strip other DLL's and ran into this issue (with tk85.dll to be precise).

- Almar
History
Date User Action Args
2012-11-21 15:45:09almarsetrecipients: + almar, loewis, mhammond, mark.dickinson, sable, eric.smith, techtonik, koen, tarek, eric.araujo, cgohlke, Garen, alexis, John.Cary, python-dev, abenard
2012-11-21 15:45:08almarsetmessageid: <1353512708.41.0.719254709994.issue7833@psf.upfronthosting.co.za>
2012-11-21 15:45:08almarlinkissue7833 messages
2012-11-21 15:45:07almarcreate