xdg-open (to gnome-open) fails to launch file:// URL with query string

Bug #396162 reported by Jacob Smith on 2009-07-06
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Xdg-utils
Fix Released
Medium
xdg-utils (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: xdg-utils

Attempting to launch a file URL with a query string attached fails using xdg-open (calls gnome-open on my system). I can successfully launch with an anchor tag but not query string. If you try to launch directly with firefox it is successful.

Ubuntu 9.04 w/Gnome
libgnome2-0:
  Installed: 2.26.0-0ubuntu2
xdg-utils:
  Installed: 1.0.2-6.1

Examples:

Fails:
$ xdg-open
'file:///home/jsmith/.wine/dosdevices/c:/users/jsmith/Desktop/Server/fpweb/index.htm?dirname=CPA&pagename=add.htm'
Error showing url: Error stating file
'/home/jsmith/.wine/dosdevices/c:/users/jsmith/Desktop/Server/fpweb/index.htm?dirname=CPA&pagename=add.htm':
No such file or directory

$ gnome-open
'file:///home/jsmith/.wine/dosdevices/c:/users/jsmith/Desktop/Server/fpweb/index.htm?dirname=CPA&pagename=add.htm'
Error showing url: Error stating file
'/home/jsmith/.wine/dosdevices/c:/users/jsmith/Desktop/Server/fpweb/index.htm?dirname=CPA&pagename=add.htm':
No such file or directory

Works:
$ xdg-open
'file:///home/jsmith/.wine/dosdevices/c:/users/jsmith/Desktop/Server/fpweb/index.htm'

$ gnome-open
'file:///home/jsmith/.wine/dosdevices/c:/users/jsmith/Desktop/Server/fpweb/index.htm'

$ gnome-open 'file:///home/jsmith/Desktop/test/introduction.html#AEN11'

$ firefox 'file:///home/jsmith/.wine/dosdevices/c:/users/jsmith/Desktop/Server/fpweb/index.htm?dirname=CPA&pagename=add.htm'

Paul Brannan (curlypaul924) wrote :

This seems like a bug in gnome-open rather than xdg-open.

FWIW, I'm having the same problem with the python webbrowser module.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in xdg-utils (Ubuntu):
status: New → Confirmed
Sam Tobin-Hochstadt (samth) wrote :

This is still a bug on 11.10, and it's a bug in xdg-open, since gnome-open is no longer installed or relevant.

If foo.html exists, then:

$ xdg-open foo.html

opens a web browser, but

$ xdg-open foo.html?a=b

gvfs-open: file:///home/samth/tmp/time/racket-full-5.2.1.5/collects/typed-racket/foo.html%3Fa=b: error opening location: Error stating file '/home/samth/tmp/time/racket-full-5.2.1.5/collects/typed-racket/foo.html?a=b': No such file or directory

Note that:

$ firefox foo.html?a=b

works correctly

Changed in xdg-utils:
importance: Unknown → Medium
status: Unknown → Confirmed

Created attachment 98059
fix for anchors and variables in urls (i.e. # and ? after file names)

The interesting lines are 649, 650.
The additional changes are just modified variable names, since using "command" as a variable name breaks vim syntax highlighting

Comment on attachment 98059
fix for anchors and variables in urls (i.e. # and ? after file names)

based on arch package version: 1.1.0.git20140207-1

I'd prefer not conflating the fix for this bug and renaming variables.

Is the core fix mostly in the final hunk of the proposed patch?

*** Bug 50715 has been marked as a duplicate of this bug. ***

Changed in xdg-utils:
status: Confirmed → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xdg-utils - 1.1.0~rc3+git20150907-1ubuntu1

---------------
xdg-utils (1.1.0~rc3+git20150907-1ubuntu1) wily; urgency=low

  * Merge from Debian unstable. Remaining changes: (LP: #1495273)
    - debian/patches:
      * gnome-3.0.diff: Correctly open preferred browser with
        gnome-open (LP: #670128)
      * lp779156-lubuntu.diff: Add open_lxde and run_sylpheed function
        for improved LXDE and sylpheed support (LP: #779156)
      * xdg-screensaver-restore-timeout.diff: restore previous X11
        screensaver timeout when xdg-screensaver resume is used (LP: #1363540)
  * New upstream release fixes the following bugs:
    - xdg-mime query filetype does not work on KDE 5 (LP: #1454833)
    - xdg-open doesn't properly detect Xfce/Xubuntu (LP: #1388922)
    - xserver-blanking patch in Ubuntu duplicates code (LP: #1330386)
    - Typo in manpage of 'xdg-icon-resource' (LP: #996304)
    - xdg-open (to gnome-open) fails to launch file:// URL with query string
      (LP: #396162)

 -- Sean Davis <email address hidden> Sun, 13 Sep 2015 12:39:10 -0400

Changed in xdg-utils (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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