Error with seperator handling?

Sebastian Spaeth Sebastian at SSpaeth.de
Thu Dec 1 09:44:47 GMT 2011


On Fri, 18 Nov 2011 10:23:21 +0100, HeX <dietmarw at gmx.de> wrote:
> I was trying to run offlineimap with a conifguration where I clone a
> read-only IMAP account to a GMAIL account.
> 
> Runing the script I get multiples of the following error:
> 
>  expected a character buffer object
>  ERROR: ERROR in syncfolder for TEST folder [Gmail]/Trash: Traceback
> (most recent call last):
>   File "/path/to/offlineimap/accounts.py", line 296, in syncfolder
>     replace(remoterepos.getsep(), localrepos.getsep()))
> TypeError: expected a character buffer object

Aye, thanks for reporting this was a true bug. We only fetched the list
of folders lazily when needed for the first time. And this also
initialized the folder delimiter for IMAP repositories as a
side-effect. But in case the local IMAP repository was read-only we
would not get the list of folders early enough and the folder delimiter
was still "None". I pushed these three commits to the next branch which
fix this and throw errors in case we still access the folder delimiter
when not initialized.

c93f871 Init folder list early enough
bf4127c Remove unused imapserver getdelim()
20f2edf Sanity check to notify us when we call IMAPRepository.getsep()
too early


This is in my "next" branch now.

Thanks for reporting,
Sebastian
> 
> 
> For me it looked like it didn't like the seperator in the GMAIL side. So
> I added
> sep = /
> 
> to the configuration but that didn't change any thing.
> 
> Any idea what's going wrong here?
> 
> I'm running offlineimap from the current master (commit
> e5a26dcfd8a2631f8fcbe8e0c32abed85fc7cd84) branch.
> 
> Here my striped offlineimaprc:
> 
> ---8<---
> [general]
> accounts = TEST
> ui = TTYUI
> maxconnections = 3
> 
> [Account TEST]
> localrepository = IMAP
> remoterepository = GMAIL
> 
> [Repository IMAP]
> type = IMAP
> remotehost = ...
> remoteuser = ...
> remotepass = ...
> ssl = yes
> readonly = yes
> folderfilter = lambda foldername: foldername in ['INBOX', 'Sent']
> 
> 
> [Repository GMAIL]
> type = Gmail
> remoteuser = ...
> remotepass = ...
> ssl = yes
> realdelete = no
> sep = /
> ---8<---
> 
> Thanks,
> HeX
> 
> _______________________________________________
> OfflineIMAP-project mailing list
> OfflineIMAP-project at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/offlineimap-project
> 
> OfflineIMAP homepage: http://software.complete.org/offlineimap
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/offlineimap-project/attachments/20111201/cafd48a5/attachment.sig>


More information about the OfflineIMAP-project mailing list