◐ Shell
reader mode source ↗
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
4 changes: 0 additions & 4 deletions Lib/test/test_memoryio.py
Original file line number Diff line number Diff line change
Expand Up @@ -1026,10 +1026,6 @@ def test_relative_seek(self):
def test_flags(self):
return super().test_flags()

@unittest.expectedFailure # TODO: RUSTPYTHON; AttributeError: 'StringIO' object has no attribute 'detach'
def test_detach(self):
return super().test_detach()

@unittest.expectedFailure # TODO: RUSTPYTHON; AttributeError: 'StringIO' object has no attribute 'newlines'. Did you mean: 'readlines'?
def test_newlines_property(self):
return super().test_newlines_property()
Expand Down
5 changes: 2 additions & 3 deletions Lib/test/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def clear_typing_caches():

class TypesTests(unittest.TestCase):

@unittest.skipUnless(c_types, "TODO: RUSTPYTHON; requires _types module")
def test_names(self):
c_only_names = {'CapsuleType'}
ignored = {'new_class', 'resolve_bases', 'prepare_class',
Expand Down Expand Up @@ -636,7 +635,7 @@ def test_slot_wrapper_types(self):
self.assertIsInstance(object.__lt__, types.WrapperDescriptorType)
self.assertIsInstance(int.__lt__, types.WrapperDescriptorType)

@unittest.expectedFailure # TODO: RUSTPYTHON; No signature found in builtin method __get__ of 'method_descriptor' objects.
@unittest.skipIf(MISSING_C_DOCSTRINGS,
"Signature information for builtins requires docstrings")
def test_dunder_get_signature(self):
Expand All @@ -661,7 +660,7 @@ def test_method_descriptor_types(self):
self.assertIsInstance(int.from_bytes, types.BuiltinMethodType)
self.assertIsInstance(int.__new__, types.BuiltinMethodType)

@unittest.expectedFailure # TODO: RUSTPYTHON; ModuleNotFoundError: No module named '_queue'
def test_method_descriptor_crash(self):
# gh-132747: The default __get__() implementation in C was unable
# to handle a second argument of None when called from Python
30 changes: 30 additions & 0 deletions crates/vm/src/stdlib/_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -789,11 +789,41 @@ mod _io {

#[pyclass(flags(BASETYPE, HAS_WEAKREF))]
impl _TextIOBase {
#[pygetset]
fn encoding(_zelf: PyObjectRef, vm: &VirtualMachine) -> PyObjectRef {
vm.ctx.none()
}

#[pygetset]
fn errors(_zelf: PyObjectRef, vm: &VirtualMachine) -> PyObjectRef {
vm.ctx.none()
Loading
Toggle all file notes Toggle all file annotations