xdg-open breaks on spaces in paths when using generic open method
Bug #220750 reported by
John Carlyle-Clarke
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Xdg-utils |
Fix Released
|
Medium
|
|||
xdg-utils (Ubuntu) |
Fix Released
|
Low
|
Unassigned |
Bug Description
Binary package hint: xdg-utils
xdg-utils 1.0.1-2 on Ubuntu Gutsy
xdg-open tries to detect the desktop environment and falls back to a generic method using run-mailcap. There is a bug in this function that means if the path contains a space, the method fails.
e.g.
johncc@liberator:~$ xdg-open Fire\ stockists.txt
local: 438: stockists.txt: bad variable name
Warning: unknown mime-type for "Fire" -- using "application/*"
Error: no such file "Fire"
There are some missing quotes in the code. I have submitted a patch which works for me. I hope I've done it right - first time submitting a patch!
Changed in xdg-utils: | |
status: | Confirmed → Triaged |
Changed in xdg-utils: | |
status: | Unknown → Confirmed |
Changed in xdg-utils: | |
status: | Confirmed → Fix Released |
Changed in xdg-utils: | |
importance: | Unknown → Medium |
Changed in xdg-utils: | |
importance: | Medium → Unknown |
Changed in xdg-utils: | |
importance: | Unknown → Medium |
To post a comment you must log in.
Confirmed this behavior in Hardy (xdg-utils 1.0.2-2) with the following:
greg@alexandria :~$echo $GNOME_ DESKTOP_ SESSION_ ID :~$unset GNOME_DESKTOP_ SESSION_ ID :~$echo $GNOME_ DESKTOP_ SESSION_ ID
Default
greg@alexandria
greg@alexandria
greg@alexandria :~$touch file\ with\ spaces.txt :~$xdg- open file\ with\ spaces.txt :~$touch file%20with%20a\ space.txt :~$ls | grep file :~$xdg- open file%20with%20a\ space.txt
greg@alexandria
local: 438: spaces.txt: bad variable name
Warning: unknown mime-type for "file" -- using "application/*"
Error: no such file "file"
greg@alexandria
greg@alexandria
file%20with%20a space.txt
file with spaces.txt
greg@alexandria
local: 438: space.txt: bad variable name
Warning: unknown mime-type for "file%20with%20a" -- using "application/*"
Error: no such file "file%20with%20a"
After an "export GNOME_DESKTOP_ SESSION_ ID=Default" the above xdg-open commands work as expected.