Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/5447#discussion_r28230539
--- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala ---
@@ -1659,9 +1659,14 @@ private[spark] object Utils extends Logging {
val windowsDrive = "([a-zA-Z])".r
/**
- * Format a Windows path such that it can be safely passed to a URI.
+ * Format a path such that it can be safely passed to a URI.
*/
- def formatWindowsPath(path: String): String = path.replace("\\", "/")
+ def formatPath(path: String, windows: Boolean): String = {
+ val formatted = path.replace(" ", "%20")
--- End diff --
```
new java.net.URI(null, "/a#b", null).toString
res1: String = /a%23b
```
... is technically correct, if this is what you mean. `#` denotes the start
of the fragment portion of a URI, so when it occurs in the path, it must be
escaped. The URIs we create here will not have a fragment. So I think
@vanzin's change sounds more robust to similar cases like this.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]