From 8c74b1e437e0b54c766b1325db56f852331c6645 Mon Sep 17 00:00:00 2001 From: WindSoilder Date: Tue, 7 Jun 2022 21:22:52 +0800 Subject: [PATCH] print warning message if meet non utf-8 path (#5731) --- crates/nu-glob/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/nu-glob/src/lib.rs b/crates/nu-glob/src/lib.rs index 58a5aafc78..ce4ed0d990 100644 --- a/crates/nu-glob/src/lib.rs +++ b/crates/nu-glob/src/lib.rs @@ -422,7 +422,10 @@ impl Iterator for Paths { // FIXME (#9639): How do we handle non-utf8 filenames? // Ignore them for now; ideally we'd still match them // against a * - None => continue, + None => { + println!("warning: get non-utf8 filename {path:?}, ignored."); + continue; + } Some(x) => x, } },