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

Function bytes_as_os_str

crates/vm/src/stdlib/os.rs:103–106  ·  view source on GitHub ↗
(b: &'a [u8], vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

101
102#[cfg(not(windows))]
103fn bytes_as_os_str<'a>(b: &'a [u8], vm: &VirtualMachine) -> PyResult<&'a std::ffi::OsStr> {
104 rustpython_common::os::bytes_as_os_str(b)
105 .map_err(|_| vm.new_unicode_decode_error("can't decode path for utf-8"))
106}
107
108pub(crate) fn warn_if_bool_fd(obj: &PyObjectRef, vm: &VirtualMachine) -> PyResult<()> {
109 use crate::class::StaticType;

Callers 5

putenvFunction · 0.70
unsetenvFunction · 0.70
as_os_strMethod · 0.50
to_path_bufMethod · 0.50
bytes_as_os_strMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected