'NoneType' object is not subscriptable

Nicolas Sebrecht nicolas.s-dev at laposte.net
Tue Jan 17 17:21:14 GMT 2012


On Mon, Jan 16, 2012 at 10:59:06PM +0100, Sebastian Spaeth wrote:
> On Tue, 10 Jan 2012 18:33:34 +0100, Nicolas Sebrecht <nicolas.s-dev at laposte.net> wrote:
> >   File "/usr/lib/python2.7/site-packages/offlineimap/folder/IMAP.py", line 78, in getuidvalidity
> >     return long(uidval[-1])
> > TypeError: 'NoneType' object is not subscriptable
> 
> Hi Nicolas,
> 
> is that reproducible?

Yes, it is.

>                       I cannot get that error somehow. And I had already
> included a "safety assert" to catch that a line earlier, which *should*
> have caught that.
> 
> If reproducible, can you add a "print uidval" before line 78 in
> folder/IMAP.py to see what the value of uidval really is? I wonder what
> has changed that we are seeing this.
> 
> folder/IMAP.py:l78
>             assert uidval != [None], "response('UIDVALIDITY') returned [None]!"
> +           print uidval
>             return long(uidval[-1])

I get 

  None

not

  [None]

which is why the assert didn't match. But it doesn't explain why I get
None in the first place. :-/


-- 
Nicolas Sebrecht




More information about the OfflineIMAP-project mailing list