[Tutor] Imaplib Select Fails while connecting folder(**Labelname) of gmail

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Tutor] Imaplib Select Fails while connecting folder(**Labelname) of gmail

Anurag Maherchandani
I am using imaplib module for connecting to Gmail Imap, and i am getting the below mentioned error. 
I am using select command to connect

Labelname is  **LabelName 


I Get this Error:

    resp, data = self._imap.select("**LabelName")
  File "/usr/lib/python2.6/imaplib.py", line 642, in select
    typ, dat = self._simple_command(name, mailbox)
  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 895, in _command_complete
    raise self.error('%s command error: %s %s' % (name, typ, data))
imaplib.error: SELECT command error: BAD ['Could not parse command']

whereas if the Labelname is 
** LabelName 

It successfully connects. 



_______________________________________________
Tutor maillist  -  [hidden email]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Reply | Threaded
Open this post in threaded view
|

Re: [Tutor] Imaplib Select Fails while connecting folder(**Labelname) of gmail

Steven D'Aprano-8
Anurag Maherchandani wrote:

> I am using imaplib module for connecting to Gmail Imap, and i am getting
> the below mentioned error.
> I am using select command to connect
>
> Labelname is  **LabelName
>
>
> I Get this Error:
>
>     resp, data = self._imap.select("**LabelName")
>   File "/usr/lib/python2.6/imaplib.py", line 642, in select
>     typ, dat = self._simple_command(name, mailbox)
>   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 895, in _command_complete
>     raise self.error('%s command error: %s %s' % (name, typ, data))
> imaplib.error: SELECT command error: BAD ['Could not parse command']
>
> whereas if the Labelname is
> ** LabelName
>
> It successfully connects.


Do you have a question? Since it successfully connects when you give the name
"** LabelName", I don't understand what your problem is.

Is there something that makes you think that select("**LabelName") should also
work?



--
Steven

_______________________________________________
Tutor maillist  -  [hidden email]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor