Re: Error: '__main__.NautilusVFSFile' object is not iterable

On Sun, 2012-03-04 at 18:02 +0100, Giuseppe Tondi wrote:

> Unfortunately, Nautilus does not like these lines and spits out an
> error:
> Traceback (most recent call last):
>   File
> "/home/vigil/.local/share/nautilus-python/extensions/",
> line 63, in get_background_items
>     sub_menuitem.connect('activate', self.root_terminal,
> re.escape(current_directory))
>   File "/usr/lib/python2.7/", line 208, in escape
>     s = list(pattern)
> TypeError: '__main__.NautilusVFSFile' object is not iterable
> I'm sure I'm missing something obvious, but I supposed that
> 'current_directory' in get_background_items was simply... the current
> directory. It turns out that it is a mysterious iterable object I
> wasn't aware of.

Hi Giuseppe,

I'm no python expert, but it looks to me like what you need to pass to
escape() is a string, right? current_directory is probably an object
implementing NautilusFileInfo, so can you try calling get_uri() on it
and pass that in the callback?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]