#787557 exo-utils: exo-open seems confused by escaped characters in URL's

Package:
exo-utils
Source:
exo
Description:
Utility files for libexo
Submitter:
Luis Mochan
Date:
2015-06-16 18:48:04 UTC
Severity:
normal
Tags:
#787557#5
Date:
2015-06-02 18:10:20 UTC
From:
To:
Dear Maintainer,

With exo-open I can open a file or directory with embedded spaces using a
command like

  exo-open 'A B'
  exo-open 'A\ B'
or
  exo-open 'file:/home/user/A B'
but I can't open the file using URL escaped characters as in
  exo-open 'file:/home/user/A%20B'
I found this problem while using Calibre, as it replaces spaces by %20's before
opening files. I'm sorry I'm not sure if this is Calibre's fault or exo-open's
fault.

Thanks,
Luis

#787557#10
Date:
2015-06-16 18:17:20 UTC
From:
To:
I made some more tests.
I can open a file named 'A B' (with a space in its name) using
 1  exo-open 'A B'
or
 2  exo-open A\ B
I can also open it with thunar using
 3  thunar 'A B'
or
 4  thunar A\ B
I can not open it using and URI as in
 5  exo-open file:A\ B
nor can I open it with
 6  thunar file:A\ B
In case 5 above there is an error message from thunar, unable to open
the file A%20B. So the translation space->%20 seems to be done by
exo-open before calling thunar.
Nevertheless, if I use the full path, not relative paths, both commands
succeed:
 7  exo-open file:/home/user/A\ B
but I can open it with thunar with the same syntax
 8  thunar file:/home/user/A\ B
It confuses me that if I introduce the escaped space by hand,
 9  exo-open file:/home/user/A%20B
 10  thunar file:///home/user/A%20B

the call 9 to exo-open fails but the call 10 to thunar does succeed.
Could it be that exo-open is escaping the '%''s? Finally, the call
 11 thunar file:A%20B
fails.

In conclusion, it seems that exo-open fails when it is handed a URI with
spaces replaced by %20.

My problem is that calibre uses exo-open and makes the replacement
before calling it. I'm made up an ugly solution: I put in my path a fake
exo-open that replaces back %20's to spaces before calling the real
exo-open.

Regards,
Luis