Accessing files with python in flatpak

I have a code like this which works fine when running directly:

def on_button_clicked(button):

def on_filedialog_response(filedialog, task):
       file = filedialog.open_finish(task)
   except GLib.GError:
       # gtk-dialog-error-quark: Dismissed by user
       data =

But when I run it in flatpak, I can’t access the file. The output is:

Traceback (most recent call last):
  File "/app/lib/python3.11/site-packages/carburetor/", line 300, in on_filedialog_response
    data =
gi.repository.GLib.GError: g-io-error-quark: Error opening file /run/user/1000/doc/19c44102/gvimrc: No such file or directory (1)

Edited: Sorry, Emmanuele is right, I just miss the file path is under "

You need permission to access the directory, this is done by adding some type of filesystem access permission to your application manifest, something like:


No, you don’t need access permission for files in the document storage; that’s the whole point of the document and file selection portals.

Where is the original gvimrc file located?

That exact file is in /etc/vim/, but it really doesn’t matter where the file is located. I tried many files from different locations on different machines.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.