MCPcopy Create free account
hub / github.com/dgrunwald/rust-cpython / new_utf8

Method new_utf8

src/objects/exc.rs:176–189  ·  view source on GitHub ↗
(
        py: Python,
        input: &[u8],
        err: std::str::Utf8Error,
    )

Source from the content-addressed store, hash-verified

174 }
175
176 pub fn new_utf8(
177 py: Python,
178 input: &[u8],
179 err: std::str::Utf8Error,
180 ) -> PyResult<UnicodeDecodeError> {
181 let pos = err.valid_up_to();
182 UnicodeDecodeError::new(
183 py,
184 cstr!("utf-8"),
185 input,
186 pos..pos + 1,
187 cstr!("invalid utf-8"),
188 )
189 }
190}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected