[ https://issues.apache.org/jira/browse/HADOOP-15217?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Joseph Fourny updated HADOOP-15217: ----------------------------------- Description: When _FsUrlStreamHandlerFactory_ is registered with _java.net.URL_ (ex: when Spark is initialized), it breaks URLs with spaces (even though they are properly URI-encoded). I traced the problem down to _FSUrlConnection.connect()_ method. It naively gets the path from the URL, which contains encoded spaces, and pases it to _org.apache.hadoop.fs.Path(String)_ constructor. This is not correct, because the docs clearly say that the string must NOT be encoded. Doing so causes double encoding within the Path class (ie: %20 becomes %2520). See attached JUnit test. was: When _FsUrlStreamHandlerFactory_ is registered with java.net.URL (ex: when Spark is initialized), it breaks URLs with spaces (even though they are properly URI-encoded). I traced the problem down to _FSUrlConnection.connect()_ method. It naively gets the path from the URL, which contains encoded spaces, and pases it to _org.apache.hadoop.fs.Path(String)_ constructor. This is not correct, because the docs clearly say that the string must NOT be encoded. Doing so causes double encoding within the Path class (ie: %20 becomes %2520). > org.apache.hadoop.fs.FsUrlConnection does not handle paths with spaces > ---------------------------------------------------------------------- > > Key: HADOOP-15217 > URL: https://issues.apache.org/jira/browse/HADOOP-15217 > Project: Hadoop Common > Issue Type: Bug > Components: fs > Affects Versions: 2.6.5 > Reporter: Joseph Fourny > Priority: Major > Attachments: TestCase.java > > > When _FsUrlStreamHandlerFactory_ is registered with _java.net.URL_ (ex: when > Spark is initialized), it breaks URLs with spaces (even though they are > properly URI-encoded). I traced the problem down to > _FSUrlConnection.connect()_ method. It naively gets the path from the URL, > which contains encoded spaces, and pases it to > _org.apache.hadoop.fs.Path(String)_ constructor. This is not correct, because > the docs clearly say that the string must NOT be encoded. Doing so causes > double encoding within the Path class (ie: %20 becomes %2520). > See attached JUnit test. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org