Files whose name starts with letters followed by a colon don’t open via dbus
If I try through D-Bus to open files whose name starts with one or more [a-zA-Z] immediately followed by a colon, I get the following error message: “Could not read file from GIO and copy it to a temporary file.” There is no problem if there is at least a space, a number or a Greek letter before the colon.
This is not a new problem, it dates back to a few years.
Here’s a minimal Python script to reproduce the problem, using dbus-python:
#!/bin/python3
import dbus
import subprocess
import time
zathuraPopen = subprocess.Popen(['zathura', '--log-level=debug'])
zathuraName = 'org.pwmt.zathura.PID-' + str(zathuraPopen.pid)
time.sleep(1.0)
zathuraObject = dbus.SessionBus().get_object(zathuraName, '/org/pwmt/zathura')
zathuraDBus = dbus.Interface(zathuraObject, 'org.pwmt.zathura')
zathuraDBus.OpenDocument("1:b.pdf", '', 1)
time.sleep(5.0)
zathuraDBus.OpenDocument("a:b.pdf", '', 1)
time.sleep(5.0)
zathuraDBus.OpenDocument("x:b.pdf", '', 1)
Executed in a directory where the first two files exist (and are identical), whereas the third doesn’t, for both the existing a:b.pdf
and the nonexisting x:b.pdf
I get the error message quoted above as well as the following messages in the terminal:
debug: ../zathura/dbus-interface.c:392: handle_method_call(): Handling call 'org.pwmt.zathura.OpenDocument' on '/org/pwmt/zathura'.
error: Can not copy to temporary file: Operation not supported