evince thinks colon in filename means url syntax

Bug #160996 reported by to be removed
28
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Evince
Invalid
Medium
evince (Ubuntu)
Triaged
Low
Unassigned

Bug Description

Binary package hint: evince

Evince does not seem to be able to open a file with a colon in the name:

> liw@dorfl$ evince 'foo:bar'.pdf
>
> (evince:12543): libgnomevfs-CRITICAL **: gnome_vfs_uri_is_local: assertion `uri != NULL' failed

This is probably due to some kind of assumption that the colon indicates a protocol in a URI scheme. It is highly surprising to the user, and if it can't be fixed (by seeing if a file with that name actually exists), at least the user should get a more sensible error message than "File not found".

Revision history for this message
Pedro Villavicencio (pedro) wrote :

Thanks for the report, can you open a text file with similar name in vi, gedit, or emacs? it seems that you need to use something like \'foo\:bar\'.pdf, i really don't consider this an evince bug.

Changed in evince:
assignee: nobody → desktop-bugs
status: New → Incomplete
Revision history for this message
to be removed (liw) wrote :

I would've answered this earlier, but launchpad either never sent me an e-mail about this, or it never reached me.

I can open files with similar names without problems in less, vi, and emacs. Gedit has the same problem as evince.

Revision history for this message
Michael Rooney (mrooney) wrote :

Hi Lars. I notice the title says trouble with escaped shell characters, but as Pedro mentioned, you aren't actually escaping them, unless by escaping you are referring to the quotes around just part of the filename. I have never seen a partially quoted filename but perhaps it is valid. If this is the case can you try escaping the colon with a backslash, otherwise if the single quotes are part of the filename, try Pedro's solution, and report back? Thanks!

Changed in evince:
importance: Undecided → Low
Revision history for this message
to be removed (liw) wrote :

Mike,

you're right, I did not escape the colon in a way that changes what the program gets. I just tried that, it doesn't matter.

There are, of course, ways of entering the filename in a way that makes evince (or other GNOME) programs be able to open them. One can enter the path in a way to have a slash before the colon (./foo:bar.pdf) or even a file:// url. However, the documentation (manpage, --help) claims that evince accepts filenames and that is clearly wrong. Evince accepts more than just filenames, and some valid filenames are interepreted wrongly.

This can be fixed via, for example, fixing the documentation to clearly say that the programs accept filenames or URLs. This, at least, would make it obvious to the user that the colon may be a problem.

(I'm also having a hard time seeing why this bug is incomplete, fixing that...)

Revision history for this message
to be removed (liw) wrote :

changing from incomplete to new since I can't see any missing information (before changing back to incomplete, please try to reproduce it first)

Changed in evince:
status: Incomplete → New
Revision history for this message
Dimitrios Symeonidis (azimout) wrote :

confirmed

i renamed an existing pdf file to foo:bar.pdf and typed evince foo\:bar.pdf in a terminal.
evince opened with an error message "the specified location is not supported"
however, double-clicking the same foo:bar.pdf in nautilus opens it in evince without a problem...

Changed in evince:
status: New → Confirmed
Revision history for this message
GiuseppeVerde (launchpad-digitasaru) wrote :

I helped chase down a similar bug earlier in gnumeric a year or two ago. The problem there was that the colon was causing the url identifier to believe that the file is a url of "<pathuptocolon>:<stuffaftercolon".

The same is the case here. forcing a file:// url works regarless of colon. The bug is triggered on colon, and that's what I searched for.

So the workaround is to use the file:// url syntax, and the solution is for someone to reach in to evince and fix the horkage. This might be in gvfs's command-line parser; I don't know and don't have time to fish around to find the fix (I have to leave town in 4 days and I must have my dissertation defence scheduled by then, which requires having the dissertation done)

Revision history for this message
Pedro Villavicencio (pedro) wrote :

Thanks for your bug report. This bug has been reported to the developers of the software. You can track it and make comments here: http://bugzilla.gnome.org/show_bug.cgi?id=589168

Changed in evince (Ubuntu):
status: Confirmed → Triaged
Changed in evince:
importance: Undecided → Unknown
status: New → Unknown
Changed in evince:
status: Unknown → New
Revision history for this message
Pedro Villavicencio (pedro) wrote :

according to the glib maintainers this is not a bug:

"This is behaving pretty much as documented:

  The value of @arg can be either a URI, an absolute path or a relative path
  resolved relative to the current working directory.
"

Changed in evince (Ubuntu):
status: Triaged → Invalid
Revision history for this message
to be removed (liw) wrote :

foo:bar.pdf is a relative path, so I conclude the upstream glib maintainers are wrong about this, assuming this still happens on karmic (I don't have access to my karmic machine right now to test).

Changed in evince (Ubuntu):
status: Invalid → Triaged
Revision history for this message
Pedro Villavicencio (pedro) wrote :

Lars, may you comment upstream since you know better about this issue? Thanks in advance.

Changed in evince:
status: New → Invalid
Revision history for this message
Timmy Shih Jun Yee (shijun) wrote :

Anyone following this bug may be interested in this:
https://bugzilla.gnome.org/show_bug.cgi?id=374341

Changed in evince:
importance: Unknown → Medium
Changed in evince (Ubuntu):
assignee: Ubuntu Desktop Bugs (desktop-bugs) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.