On Thu, 27 Jul 2006, Sebastien Delafond wrote:

> I still can't reproduce this one... Do you see the same behavior with
> another fsName ?

I tried changing fsnames and mountpoints, which didn't change anything.  
Finally, despite not really knowing python, I decided to dig into the 
source and see if I could get anywhere, and I think I did ...

> > Traceback (most recent call last):
> >   File "/usr/share/gmailfs/gmailfs.py", line 701, in getdir
> >     log.debug("thread.summary is " + thread.snippet)
> > TypeError: cannot concatenate 'str' and 'list' objects

This exception is in a try/except block.  So the exception gets logged, 
and then the code continues.

> > Traceback (most recent call last):
> >   File "/usr/lib/python2.3/site-packages/fuse.py", line 40, in __call__
> >     return apply(self.func, args, kw)
> >   File "/usr/share/gmailfs/gmailfs.py", line 725, in getdir
> >     return map(lambda x: (x,0), lst)
> > TypeError: argument 2 to map() must support iteration

Argument 2 is the lst variable, hmm.  Well, the lst variable is 
initialized to an empty list *after* the line on which the prior 
exception occurred, so this second exception is probably happening 
because lst, at that point, is whatever python's equivalent of 
null/undef is, rather than being a list.

Question: why does your version of python not bitch about this?  From 
what I can find on google, the refusal to concatenate strings and lists 
is an inherent python behavior.  Perhaps thread.snippet is coming out as 
a different type of object for you.

Anyways, more googling, it looks like the str() function is what we 
need to convert the list to a string.  Not really knowing what's going 
on, however, I'm a bit worried that this may be masking some other 
problem.  However, a quick test with this patch was successful.

--- gmailfs.py.old      2006-07-27 17:06:47.000000000 -0400
+++ gmailfs.py.new      2006-07-27 17:06:22.000000000 -0400
@@ -698,9 +698,9 @@
             for thread in folder:
                assert len(thread) == 1
                for msg in thread:
-                 log.debug("thread.summary is " + thread.snippet)
+                 log.debug("thread.summary is " + str(thread.snippet))
                  m = re.search(FileNameTag+'='+FileStartDelim+'(.*)'+
-                               FileEndDelim, thread.snippet)
+                               FileEndDelim, str(thread.snippet))
                  if (m):
                      # Match succeeded, we got the whole filename.
                      log.debug("Used summary for filename")


-- 
        -Cheetah
"Reality is that which, when you stop believing in it, doesn't go away".
                -- Philip K. Dick
GPG pubkey fingerprint: A57F B354 FD30 A502 795B 9637 3EF1 3F22 A85E 2AD1


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to