New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Files that have whitespace in their paths lead to test failures #435
Comments
Yes, we probably need to change all the However, there are currently too many of such Probably want a different issue to refactor them all out into a common utility method 1st for ease of future usage, and then update that method to use the decoder. @eugenepeh Your opinion on this? |
I think it can be done in a single PR, since updating the method would probably be just a few line change afterwards. |
When I work around with this issue, only adding URLDecoder is not enough. For the directories in |
@jamessspanggg your PR fixed this issue too right? Or was it just for spaces in the file name and not the file path? |
Hi, I would like to work on this issue even though it is marked as |
Go ahead. |
Go ahead @chan-j-d |
I previously worked on this issue. I think part of the reason why it is marked as |
The test suite will convert spaces in URLs into %20, which can lead to test case failures. Java API recommends managing encoding and decoding of URLs by using URI, which would resolve the issue with spaces. This could save new developers some trouble when encountering test failures while attempting to build the project locally for the first time. Let's fix the issues caused by whitespace in the test cases.
Bug:
For example, the following exception is encountered due to whitespace in
Abc Xyz
, which is in the file path to the test filestandardBlameOutput.txt
.Cause:
The exception occurs since
Path.toString()
returns the path with the spaces replaced by%20
. But,java.io.File
accepts spaces in theString pathname
, not%20
.Fix:
I think it can be fixed by replacing such instances by
String decodedPath = URLDecoder.decode(Path.toString(), "UTF-8");
The text was updated successfully, but these errors were encountered: