We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6dfbe7b commit 1af2170Copy full SHA for 1af2170
1 file changed
src/lib.rs
@@ -72,13 +72,13 @@ fn extract_path(obj: &Bound<'_, PyAny>) -> PyResult<PathBuf> {
72
73
// Try str first
74
if let Ok(s) = obj.downcast::<PyString>() {
75
- return validate_path(s.to_str()?);
+ return validate_path(&s.to_cow()?);
76
}
77
78
// Try os.PathLike via __fspath__
79
if let Ok(fspath) = obj.call_method0("__fspath__") {
80
if let Ok(s) = fspath.downcast::<PyString>() {
81
82
83
// Could be bytes, but we only support str paths
84
if let Ok(s) = fspath.extract::<String>() {
0 commit comments