Skip to contentSkip to conversation

Use PyBytes and not Unicode strings for IEC958 values

DISCUSSION GitHub pull_request - edited 1 participant 1 message Aug 16, 2024 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

alsa-project/alsa-python pull request #14 was edited from tormodvolden:

Suggested fix for #13.

- the first commit is not strictly related but also needed to avoid hctltest1.py crashing with my audio devices, where some have info.count = 0. Let me know if more information is needed. I don't know if this is expected or if a warning should be issued.

- I went for PyBytes instead of PyByteArray

- for setting values, if the provided PyBytes value is shorter than the value, it will be zero-padded.
- if it is too long, it will be silently truncated

- following the existing code style, no empty lines were inserted, but this could help readability

- the third commit is not for fixing the crash, but for fixing set_tuple() to actually do anything for IEC958

- I haven't changed the reference counting, which seems wrong to me in the original code as well. This would be a different issue.

Request URL : https://github.com/alsa-project/alsa-python/pull/14
Patch URL : https://github.com/alsa-project/alsa-python/pull/14.patch
Repository URL: https://github.com/alsa-project/alsa-python