Unfortunately this will make it tricky to use PySpark in unit tests that share the same JVM (though I guess our unit tests for it currently all spawn new JVMs because they're in Python). Could you make this a class and add a member of it in SparkEnv instead? Then you can do SparkEnv.get.pythonWorker in your RDD.