Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix io warning
  • Loading branch information
youknowone committed Dec 29, 2025
commit b3397689d239b6ce466646e28248a335b21bb815
10 changes: 10 additions & 0 deletions crates/vm/src/stdlib/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4489,6 +4489,16 @@ mod _io {
bool::try_from_object(vm, atty)?
};

// Warn if line buffering is requested in binary mode
if opts.buffering == 1 && matches!(mode.encode, EncodeMode::Bytes) {
crate::stdlib::warnings::warn(
vm.ctx.exceptions.runtime_warning,
"line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used".to_owned(),
1,
vm,
)?;
}

let line_buffering = opts.buffering == 1 || isatty;

let buffering = if opts.buffering < 0 || opts.buffering == 1 {
Expand Down