Skip to content

Commit 1866f85

Browse files
committed
Windows is not cooperating
Splitting a string on java.io.File.separator on Windows (i.e. "\") fails with a PatternSyntaxException.
1 parent 456d844 commit 1866f85

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/scala/org/apache/spark/util/Utils.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,7 @@ private[spark] object Utils extends Logging {
11011101
* Strip the directory from a path name
11021102
*/
11031103
def stripDirectory(path: String): String = {
1104-
path.split(File.separator).last
1104+
new File(path).getName
11051105
}
11061106

11071107
/**

0 commit comments

Comments
 (0)