can't view PDFs with spaces in their name

When I attempt to view a PDF attachment called "My File.pdf" in Zotero 4.0.11 standalone on Ubuntu Linux 13.04, the application displays a message 'Failed to open "/path_to_file/My". This seems to reflect some problem handling files with spaces in their name. Is there some way to fix this?
  • That's certainly not a general problem - Zotero's own default PDF rename includes spaces and linux handles spaces in filenames elegantly.

    How are you opening that PDF exactly? And what does it say in the right-hand panel under "Filename"?
  • I'm opening the file either by double-clicking on the attachment in the central panel or selecting "View PDF" from the pop-up menu after right-clicking on the attachment; in both cases, the response is the same.

    The attachment is imported into Zotero when I save an online journal article for which there exists a Zotero translator. The filename in the right-hand panel (which appears to be set using metadata from the file) contains spaces, e.g., "Doe et al. - 2000 - Article Title.pdf".
  • I also observe the file opening problem if I manually attach a file whose name contains spaces.
  • if you click on "Show File" and then double-click the actual file in nautilus, does that work?
  • Yes - that works fine.
  • could you provide a debug ID that covers two steps:
    1. manually attaching a link to a file with spaces in the filename
    2. trying to open that file from within Zotero

    http://www.zotero.org/support/debug_output
  • Done - debug ID is D1821672641.
  • Can you tell what is actually displaying the error message you're seeing? Are you sure it's Zotero? Zotero is just running the Mozilla launch() method on the file object to launch the file via the OS. Often on Linux that fails, since there's no universal file launcher, and it falls back (by default) to xdg-open, but that doesn't seem to be happening in your case. So it seems that something on your system is actually trying to handle file.lanuch() but failing. Unfortunately we don't have any control over that, and there are about a half-dozen different places to configure what handles it.

    Not very helpful, I know, but that's the situation. The first step is figuring out where that dialog is actually coming from, if you can.
  • Mozilla was launching my system's default file manager (Thunar). The problem was that the file manager's arguments were not being properly quoted; hence, the presence of spaces resulted in an attempt to open a non-existent file. Adding quotes to the string used to invoke the file manager solved the problem.

    Thanks for your assistance!
Sign In or Register to comment.