File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed
main/scala/org/apache/spark/deploy
test/scala/org/apache/spark/deploy
repl/scala-2.10/src/main/scala/org/apache/spark/repl Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -19,10 +19,10 @@ package org.apache.spark.deploy
1919
2020import java .net .URI
2121import java .io .File
22- import scala .util .Try
2322
2423import scala .collection .mutable .ArrayBuffer
2524import scala .collection .JavaConversions ._
25+ import scala .util .Try
2626
2727import org .apache .spark .api .python .PythonUtils
2828import org .apache .spark .util .{RedirectThread , Utils }
@@ -98,7 +98,7 @@ object PythonRunner {
9898
9999 // In Windows, the drive should not be prefixed with "/"
100100 // For instance, python does not understand "/C:/path/to/sheep.py"
101- if (formattedPath.matches(" /[a-zA-Z]:/.*" )) {
101+ if (Utils .isWindows && formattedPath.matches(" /[a-zA-Z]:/.*" )) {
102102 formattedPath = formattedPath.stripPrefix(" /" )
103103 }
104104 formattedPath
Original file line number Diff line number Diff line change 1818package org .apache .spark .deploy
1919
2020import org .scalatest .FunSuite
21+
2122import org .apache .spark .util .Utils
2223
2324class PythonRunnerSuite extends FunSuite {
@@ -29,9 +30,9 @@ class PythonRunnerSuite extends FunSuite {
2930 assert(PythonRunner .formatPath(" file:///spark.py" ) === " /spark.py" )
3031 assert(PythonRunner .formatPath(" local:/spark.py" ) === " /spark.py" )
3132 assert(PythonRunner .formatPath(" local:///spark.py" ) === " /spark.py" )
32- assert(PythonRunner .formatPath(" file:/C:/a/b/spark.py" , testWindows = true ) ===
33- " C:/a/b/spark.py" )
3433 if (Utils .isWindows) {
34+ assert(PythonRunner .formatPath(" file:/C:/a/b/spark.py" , testWindows = true ) ===
35+ " C:/a/b/spark.py" )
3536 assert(PythonRunner .formatPath(" C:\\ a\\ b\\ spark.py" , testWindows = true ) ===
3637 " C:/a/b/spark.py" )
3738 assert(PythonRunner .formatPath(" C:\\ a b\\ spark.py" , testWindows = true ) ===
Original file line number Diff line number Diff line change @@ -207,7 +207,7 @@ class SparkILoop(
207207 SparkILoop .getAddedJars.map { jar => new URI (jar).getPath.stripPrefix(" /" ) }
208208 } else {
209209 // 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}
210+ SparkILoop .getAddedJars.map { jar => new URI (jar).getPath }
211211 }
212212 // work around for Scala bug
213213 val totalClassPath = addedJars.foldLeft(
You can’t perform that action at this time.
0 commit comments