Rubber does not print the correct filename if it contains spaces
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Rubber |
Confirmed
|
Medium
|
Unassigned |
Bug Description
When launching rubber on a file containing spaces in its name or directory (like "/home/user/dir with spaces/doc.tex"), it only outputs
/home/usr/dir: some error
instead of
/home/user/dir with spaces/doc.tex: some error
This is important for the gedit latex plugin which uses these filenames to show the error in the source, and fails to find the file because of that.
A simple solution is to replace line 122 in rubber/
re_file = re.compile(
by
re_file = re.compile(
(we accept spaces in the filename). This should perhaps be further modified as the last space is now included in the filename. It doesn't hurt for my purposes (gedit latex plugin), but it may for others (?).
Changed in rubber: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
milestone: | none → 1.2 |
Changed in rubber: | |
milestone: | 1.2 → 1.3 |
Changed in rubber: | |
milestone: | 1.5 → none |
I also suffered from this issue, breaking the gedit latex plugin in this regard.
I further adapted the regex, since I had two issues with the proposed solution:
1) I found random [number] snippets in the file name, probably coming from latex' page count output. Thus I forbid [] in the regex.
2) For me, the gedit plugin had in fact issues with the trailing space, so I require at least one alphanumeric character as the last one.
I’m no regex expert, so there might be more elegant ways, but this currently works for me™:
re_file = re.compile( "(\\((? P<file> [^\n\t( ){}\[\] ]*\w)|\ \))")