Package: xapers
Version: 0.5.2-1
Severity: normal

Dear Maintainer,

I added pdf files to my xapers database that contain space (namely
.xapers/docs/0000000110/Di 99.pdf). Using 'xapers show id:110' then
<Return> to open said file gives 'ERROR: id:110: file not found'

I trace the problem to line 174 of file
/usr/lib/python2.7/dist-packages/xapers/nci/search.py which protects
spaces with '\' before passing this path to os.path.exists which fails
as "~/.xapers/docs/0000000110/Di\ 99.pdf" does not exist... This action
should be done after that conditional but before the subprocess.call
line.

This patch solves the problem for me:


@@ -171,10 +171,11 @@
         if not path:
             self.ui.set_status('No file for document id:%s.' % entry.docid)
             return
-        path = path[0].replace(' ','\ ')
+        path = path[0]
         if not os.path.exists(path):
             self.ui.set_status('ERROR: id:%s: file not found.' % entry.docid)
             return
+        path = path.replace(' ','\ ')
         self.ui.set_status('opening file: %s...' % path)
         subprocess.call(' '.join(['nohup', 'xdg-open', path, '&']),
                         shell=True,


-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (700, 'unstable'), (650, 'testing'), (600, 'experimental'), (500, 
'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.10-3-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages xapers depends on:
ii  poppler-utils         0.18.4-8
ii  pybtex                0.15-1
ii  python                2.7.5-5
ii  python-pkg-resources  0.6.49-2
ii  python-pycurl         7.19.0-7
ii  python-xapian         1.2.15-4

Versions of packages xapers recommends:
ii  python-urwid  1.1.1-1+b1
ii  xclip         0.12+svn84-2
ii  xdg-utils     1.1.0~rc1+git20111210-7

xapers suggests no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to