Skip to content

Commit 96839df

Browse files
authored
Merge pull request RustPython#3915 from hy-kiera/textiobase_encoding_property
implement TextIOBase encoding attribute
2 parents c5d6ef1 + 1ac66cf commit 96839df

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

vm/src/stdlib/io.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,10 +701,16 @@ mod _io {
701701
// TextIO Base has no public constructor
702702
#[pyattr]
703703
#[pyclass(name = "_TextIOBase", base = "_IOBase")]
704+
#[derive(Debug, PyPayload)]
704705
struct _TextIOBase;
705706

706707
#[pyimpl(flags(BASETYPE))]
707-
impl _TextIOBase {}
708+
impl _TextIOBase {
709+
#[pyproperty]
710+
fn encoding(&self, vm: &VirtualMachine) -> PyObjectRef {
711+
vm.ctx.none()
712+
}
713+
}
708714

709715
#[derive(FromArgs, Clone)]
710716
struct BufferSize {

0 commit comments

Comments
 (0)