Thanks - looks like it was a bad name somewhere.  The name came back as an
empty string and was bombing out.  Tried a different account and it worked
fine.

-Jim

On Sat, Oct 18, 2014 at 10:03 AM, Leonel Câmara <[email protected]>
wrote:

> It's possible that one of your mailboxes has a name that after removing
> all characters that should not be in table names becomes an empty string.
>
> imap.py does this
>
> # remove unwanted characters and store original names
> # Don't allow leading non alphabetic characters
> mailbox_name = re.sub('^[_0-9]*', '', re.sub('[^_\w]','',re.sub('[/ ]','_'
> ,mailbox)))
>
> Later in define_tables IMAPAdapter uses the names of the mailboxes to
> create a table for each one of them. I don't really know why this was
> decided instead of just using a single table with a Field mailbox.
>
> If this is indeed the problem, this can be circumvented by passing the
> mailbox_names argument to the IMAPAdapter define_tables call, this is a
> dictionary where you give table names for each mailbox. It's of the form
> {tablename: mailboxname}.
>
> That said you also found a bug in web2py because:
>
> if (not isinstance(tablename, str) or tablename[0] == '_'
>
> Should be
>
> if (not isinstance(tablename, str) or (not len(tablename)) or tablename[0]
>  == '_'
>
>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/k__I7Mxg_aM/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to