Skip to content

Commit 332d5b7

Browse files
benjefferymergify[bot]
authored andcommitted
Fix type to Py_BuildValue
1 parent be7d84f commit 332d5b7

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

python/CHANGELOG.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
- Add ``keep_rows`` method to table classes to support efficient in-place
1616
table subsetting (:user:`jeromekelleher`, :pr:`2700`)
1717

18+
**Bugfixes**
19+
20+
- Fix `UnicodeDecodeError` when calling `Variant.alleles` on the `emscripten` platform.
21+
(:user:`benjeffery`, :pr:`2754`, :issue:`2737`)
22+
1823
--------------------
1924
[0.5.4] - 2023-01-13
2025
--------------------

python/_tskitmodule.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,8 @@ make_alleles(tsk_variant_t *variant)
578578
goto out;
579579
}
580580
for (j = 0; j < variant->num_alleles; j++) {
581-
item = Py_BuildValue("s#", variant->alleles[j], variant->allele_lengths[j]);
581+
item = Py_BuildValue(
582+
"s#", variant->alleles[j], (Py_ssize_t) variant->allele_lengths[j]);
582583
if (item == NULL) {
583584
Py_DECREF(t);
584585
goto out;

0 commit comments

Comments
 (0)