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 vstinner
Recipients amaury.forgeotdarc, eric.araujo, runtux, tarek, techtonik, vstinner
Date 2011-10-14.11:59:24
SpamBayes Score 2.4424907e-15
Marked as misclassified No
Message-id <1318593566.18.0.828166300055.issue10945@psf.upfronthosting.co.za>
In-reply-to
Content
> It is not code under the users’ control (i.e. setup.py)
> that uses MBCS, but the bdist_wininst command itself.

bdist_command append configuration data to a wininst-xxx.exe binary. Where does this file come from? Can we modify wininst-xxx.exe binaries?


If we can modify the binaries, we can change the format to store the configuration data as UTF-8 instead of the ANSI code page.

It's surprising and "unsafe" (not portable) to use the ANSI code page for an installer: if you build your installer on a french setup (ANSI=cp1252), the configuration was be interpreted incorrectly on a japanese setup (ANSI=cp932). Example:

>>> 'Hé ho'.encode('cp1252').decode('cp932')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'cp932' codec can't decode bytes in position 1-2: illegal multibyte sequence

So if the configuration data (package metadata) contains non-ASCII characters, you will not be able to use your installer on a computer using a different ANSI code page than the code page of the computer used to build the installer... In the best case, you will just get mojibake.

If we cannot modify wininst-xx.exe, an alternative to be able to generate installers on non-Windows platforms is to use the most common ANSI code page (cp1252?), or maybe ASCII.

Use the ASCII encoding is the safest solution because you will be able to use your installer on all Windows setup (all ANSI code pages are compatible with ASCII), but you will not be able to generate an installer if the package metadata contains at least one non-ASCII character...
History
Date User Action Args
2011-10-14 11:59:26vstinnersetrecipients: + vstinner, amaury.forgeotdarc, techtonik, tarek, eric.araujo, runtux
2011-10-14 11:59:26vstinnersetmessageid: <1318593566.18.0.828166300055.issue10945@psf.upfronthosting.co.za>
2011-10-14 11:59:25vstinnerlinkissue10945 messages
2011-10-14 11:59:24vstinnercreate