Comment #4 on issue 3558 by gheaeckk...@gmail.com: RB doesn't handle paths
containing spaces correctly
I've been looking into this issue quickly,
The problem comes from this code :
diff_line = self.lines[linenum].split()
# Need to remove the "a/" and "b/" prefix
file_info.origFile = GIT_DIFF_PREFIX.sub(b"", diff_line[-2])
file_info.newFile = GIT_DIFF_PREFIX.sub(b"", diff_line[-1])
Parsing this line :
diff --git a/File name with spaces.pdf b/File name with spaces.pdf
This will result in origFile = "with" and newFile = "spaces.pdf"
I was thinking about doing something like using regex
But if you path looks like 'somefolder b/your file', this will fail again.
Other solution is to update file_info.origFile & file_info.newFile with
regex as you read the file
Binary files /dev/null and b/File name with spaces.pdf differ <= 'Binary
files /dev/null and b/(.*) differ'
But this mean adding code (with regex) for every condition in
If anyone thinks of a better way to deal with that, please let me know :)
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
You received this message because you are subscribed to the Google Groups
To unsubscribe from this group and stop receiving emails from it, send an email
To post to this group, send email to email@example.com.
Visit this group at http://groups.google.com/group/reviewboard-issues.
For more options, visit https://groups.google.com/d/optout.