Skip to content

Commit 2c62e3b

Browse files
committed
Merge pull request #1 from sarutak/SPARK-6568-2
Fix the class path handling logic for the case that the path includes white space(%20)
2 parents 7019a8a + 45946ee commit 2c62e3b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

repl/scala-2.10/src/main/scala/org/apache/spark/repl/SparkILoop.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@ class SparkILoop(
206206
// e.g. file:/C:/my/path.jar -> C:/my/path.jar
207207
SparkILoop.getAddedJars.map { jar => new URI(jar).getPath.stripPrefix("/") }
208208
} else {
209-
SparkILoop.getAddedJars
209+
// We need new URI(jar).getPath here for the case that `jar` includes encoded white space (%20).
210+
SparkILoop.getAddedJars.map { jar => new URI(jar).getPath}
210211
}
211212
// work around for Scala bug
212213
val totalClassPath = addedJars.foldLeft(
@@ -1109,7 +1110,7 @@ object SparkILoop extends Logging {
11091110
if (settings.classpath.isDefault)
11101111
settings.classpath.value = sys.props("java.class.path")
11111112

1112-
getAddedJars.foreach(settings.classpath.append(_))
1113+
getAddedJars.map(jar => new URI(jar).getPath).foreach(settings.classpath.append(_))
11131114

11141115
repl process settings
11151116
}

0 commit comments

Comments
 (0)