classification
Title: msilib.CAB doesnot support non-ASCII files
Type: enhancement Stage: resolved
Components: Windows Versions: Python 3.10
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: paul.moore, serhiy.storchaka, steve.dower, tim.golden, zach.ware
Priority: normal Keywords: patch

Created on 2020-06-27 15:01 by serhiy.storchaka, last changed 2020-06-30 08:56 by serhiy.storchaka. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 21195 merged serhiy.storchaka, 2020-06-28 09:43
Messages (2)
msg372466 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-06-27 15:01
There are several problems with _msi.FCICreate() used to create the CAB file. It encodes the CAB names and added file names to UTF-8 and then use them as encoded with the local encoding. So you cannot create a CAB file in a directory with non-ASCII name or add files from a directory with non-ASCII name. This is a Python 3 regression.

Two possible solutions:

1. Encode paths with the locale encoding. It will add support for paths encodable with the locale encoding.

2. Encode them to UTF-8, but use a wrapper for opening file which converts the path from UTF-8 to UTF-16 and uses the Unicode variant of _open(). It will support arbitrary names.
msg372669 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-06-30 08:56
New changeset ba67d7386edf20bcc0f878a518de0894cb574e9f by Serhiy Storchaka in branch 'master':
bpo-41142: Add support of non-ASCII paths for CAB files. (GH-21195)
https://github.com/python/cpython/commit/ba67d7386edf20bcc0f878a518de0894cb574e9f
History
Date User Action Args
2020-06-30 08:56:22serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-06-30 08:56:08serhiy.storchakasetmessages: + msg372669
2020-06-28 09:43:38serhiy.storchakasetkeywords: + patch
stage: patch review
pull_requests: + pull_request20349
2020-06-27 15:01:56serhiy.storchakacreate