summaryrefslogtreecommitdiff
path: root/natsort/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'natsort/utils.py')
-rw-r--r--natsort/utils.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/natsort/utils.py b/natsort/utils.py
index c9448b4..8d56b06 100644
--- a/natsort/utils.py
+++ b/natsort/utils.py
@@ -887,7 +887,11 @@ def path_splitter(
s = PurePath(s)
# Split the path into parts.
- *path_parts, base = s.parts
+ try:
+ *path_parts, base = s.parts
+ except ValueError:
+ path_parts = []
+ base = str(s)
# Now, split off the file extensions until we reach a decimal number at
# the beginning of the suffix or there are no more extensions.