MCPcopy Index your code
hub / github.com/RustPython/RustPython / bytes_as_os_str

Method bytes_as_os_str

crates/vm/src/function/fspath.rs:125–128  ·  view source on GitHub ↗
(b: &'a [u8], vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

123 }
124
125 pub fn bytes_as_os_str<'a>(b: &'a [u8], vm: &VirtualMachine) -> PyResult<&'a std::ffi::OsStr> {
126 rustpython_common::os::bytes_as_os_str(b)
127 .map_err(|_| vm.new_unicode_decode_error("can't decode path for utf-8"))
128 }
129}
130
131impl ToPyObject for FsPath {

Callers

nothing calls this directly

Calls 1

bytes_as_os_strFunction · 0.50

Tested by

no test coverage detected