Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Lib/test/test_bytes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1393,7 +1393,6 @@ def test_bytearray_api(self):
except OSError:
pass

@unittest.skip("TODO: RUSTPYTHON; segfault")
def test_mod_concurrent_mutation(self):
# Prevent crash in __mod__ when formatting mutates the bytearray.
# Regression test for https://github.com/python/cpython/issues/142557.
Expand Down
4 changes: 3 additions & 1 deletion crates/vm/src/builtins/bytearray.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,9 @@ impl PyByteArray {

fn __mod__(&self, values: PyObjectRef, vm: &VirtualMachine) -> PyResult<Self> {
// Formatting calls the values' conversion methods, which can reach
// this bytearray, so the format is taken by value.
// this bytearray, so the format is taken by value. It also stays
// exported until formatting ends, so resizing it raises BufferError.
let _export = self.begin_export();
let format = self.inner().clone();
let formatted = format.cformat(values, vm)?;
Ok(formatted.into())
Expand Down
Loading