panic Utf8Error
Open
Nobody has claimed this yet.
bug
- Dominant language
- Rust
- Stars
- 566
- Forks
- 163
- Avg merge
- 4h 51m
- Merged PRs (30d)
- 2
Description
Thank you for this library, but I found a problem. I have a non-utf8 encoded file on my server. When I access the server path on the Windows platform, it panics.
called
Result::unwrap()on anErrvalue: Utf8Error { valid_up_to: 10, error_len: Some(1) }
sftp.readdir(&Path::new("/usr/xxxx/"));
#[cfg(windows)]
fn mkpath(v: Vec<u8>) -> PathBuf {
use std::str;
PathBuf::from(str::from_utf8(&v).unwrap())
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Windows-only mkpath function shown in the report and trace how sftp.readdir supplies its byte path. Reproduce the issue with a non-UTF-8 filename and verify that handling the path no longer panics.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100