Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

msilib: SetProperty() accepts str, but GetProperty() returns bytes #85362

Closed
serhiy-storchaka opened this issue Jul 1, 2020 · 2 comments
Closed
Labels
OS-windows type-bug An unexpected behavior, bug, or error

Comments

@serhiy-storchaka
Copy link
Member

BPO 41190
Nosy @pfmoore, @tjguk, @zware, @serhiy-storchaka, @zooba

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2020-07-01.18:15:29.344>
labels = ['type-bug', 'OS-windows']
title = 'msilib: SetProperty() accepts str, but GetProperty() returns bytes'
updated_at = <Date 2020-07-01.18:15:29.344>
user = 'https://github.com/serhiy-storchaka'

bugs.python.org fields:

activity = <Date 2020-07-01.18:15:29.344>
actor = 'serhiy.storchaka'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Windows']
creation = <Date 2020-07-01.18:15:29.344>
creator = 'serhiy.storchaka'
dependencies = []
files = []
hgrepos = []
issue_num = 41190
keywords = []
message_count = 1.0
messages = ['372777']
nosy_count = 5.0
nosy_names = ['paul.moore', 'tim.golden', 'zach.ware', 'serhiy.storchaka', 'steve.dower']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue41190'
versions = []

@serhiy-storchaka
Copy link
Member Author

There is an inconsistency in the _msi.SummaryInformation class. Its method SetProperty() accepts str, but GetProperty() returns bytes (encoded with the Windows ANSI encoding).

Since os.fsencode()/os.fsdecode() now use UTF-8 encoding, it is not so easy to convert between bytes and str. Also, the encoding with the Windows ANSI encoding is lossy, so it may be that there is a loss in GetProperty().

@serhiy-storchaka serhiy-storchaka added OS-windows type-bug An unexpected behavior, bug, or error labels Jul 1, 2020
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
@hugovk
Copy link
Member

hugovk commented Apr 11, 2022

Note the msilib module is deprecated in 3.11 and set for removal in 3.13.

See PEP 594 – Removing dead batteries from the standard library and #91217.

@zooba zooba closed this as completed Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-windows type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants