[Gmail]/All Mail has different name for different Language

Bug #758171 reported by Jeff Girard
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Backup Gmail
In Progress
Medium
Joseph Wen

Bug Description

I got me too the same error message than the others (username or password incorrect), but the trace is different:

Traceback (most recent call last):te size]
  File "./backup_gmail.py", line 484, in <module>
    doBackup(options, TerminalProgress())
  File "./backup_gmail.py", line 454, in doBackup
    backup.backupTo([options.start_date, options.end_date], overwrite, include_labels, exclude_labels)
  File "./backup_gmail.py", line 294, in backupTo
    self.doBackup(date_range, include_labels, exclude_labels)
  File "./backup_gmail.py", line 287, in doBackup
    self.fetchAllMail(date_range, exclude_labels)
  File "./backup_gmail.py", line 253, in fetchAllMail
    self.fetchMailByLabel('[Gmail]/All Mail', date_range)
  File "./backup_gmail.py", line 160, in fetchMailByLabel
    date_range = self.searchByDate(*date_range)
  File "./backup_gmail.py", line 118, in searchByDate
    ret, result = self.gmail.search(None, '(SINCE "%s") (BEFORE "%s")' % (start, end))
  File "/usr/lib/python2.6/imaplib.py", line 620, in search
    typ, dat = self._simple_command(name, *criteria)
  File "/usr/lib/python2.6/imaplib.py", line 1060, in _simple_command
    return self._command_complete(name, self._command(name, *args))
  File "/usr/lib/python2.6/imaplib.py", line 818, in _command
    ', '.join(Commands[name])))
error: command SEARCH illegal in state AUTH, only allowed in states SELECTED
username or password incorrect

Revision history for this message
Joseph Wen (wenjoseph) wrote :

Hi:

I have uploaded a new version that I hope will solve the problem:
http://launchpad.net/backup-gmail/trunk/backup-gmail-0.1/+download/backup-gmail-0.1.2.tar.gz

Joseph Wen (wenjoseph)
Changed in backup-gmail:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Joseph Wen (wenjoseph)
Revision history for this message
Jeff Girard (jef-zapata) wrote :

I've got two errors, which I can resolve by changing two thing in code:

  File "./backup_gmail.py", line 158, in getGmailPrefix
    raise SelectMailBoxError('<All Mail>', labels)
NameError: global name 'SelectMailBoxError' is not define

- It is member of self so I just corrected it locally to go further, I got the error below:

SelectMailBoxError: MailBox [<All Mail>] does not exists.

- I'm using a french version of Gmail, and "All Mail" = "Tous les messages". I changed this and now everything is working very well!

I let you correct the code from your side, thanks a lot for this nice utilities also!

Revision history for this message
Joseph Wen (wenjoseph) wrote :

Thanks for your feedback.
I will try to address the problem of different language.

Joseph Wen (wenjoseph)
summary: - Msg username or password incorrect
+ [Gmail]/All Mail has different name for different Language
Revision history for this message
Jorge González (jag2kn) wrote :

the problem are the internationalization

I print the start and end:
u'21-abr-2002', u'20-abr-2010'

april 21 in spanish

I change:

ret, result = self.gmail.search(None, '(SINCE "%s") (BEFORE "%s")' % (start, end))
to
ret, result = self.gmail.search(None, '(SINCE "%s") (BEFORE "%s")' % (u'21-apr-2002', u'20-apr-2010'))

and run ok, then the problem are in my case the language date of start and end.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.