diff --git a/python/CHANGELOG.rst b/python/CHANGELOG.rst index 4450bf06c4..e0ff7117f1 100644 --- a/python/CHANGELOG.rst +++ b/python/CHANGELOG.rst @@ -15,6 +15,11 @@ - Add ``keep_rows`` method to table classes to support efficient in-place table subsetting (:user:`jeromekelleher`, :pr:`2700`) +**Bugfixes** + +- Fix `UnicodeDecodeError` when calling `Variant.alleles` on the `emscripten` platform. + (:user:`benjeffery`, :pr:`2754`, :issue:`2737`) + -------------------- [0.5.4] - 2023-01-13 -------------------- diff --git a/python/_tskitmodule.c b/python/_tskitmodule.c index 30c3e7743b..dea3c03fd9 100644 --- a/python/_tskitmodule.c +++ b/python/_tskitmodule.c @@ -578,7 +578,8 @@ make_alleles(tsk_variant_t *variant) goto out; } for (j = 0; j < variant->num_alleles; j++) { - item = Py_BuildValue("s#", variant->alleles[j], variant->allele_lengths[j]); + item = Py_BuildValue( + "s#", variant->alleles[j], (Py_ssize_t) variant->allele_lengths[j]); if (item == NULL) { Py_DECREF(t); goto out;