Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

imaplib thread method anomaly

1 view
Skip to first unread message

Mr SZ

unread,
Feb 3, 2009, 8:22:01 AM2/3/09
to python, pi...@it.usyd.edu.au
Hi,

I was looking at the thread functionality of IMAP4rev1 servers with the threading extension. Here is my output with debug=8 :

02:23.02 > GDJB3 UID THREAD references UTF-8 (SEEN)
02:23.02 < * THREAD (3)(2)(4)(1)
02:23.02 matched r'\* (?P<type>[A-Z-]+)( (?P<data>.*))?' => ('THREAD', ' (3)(2)(4)(1)', '(3)(2)(4)(1)')
02:23.03 untagged_responses[THREAD] 0 += ["(3)(2)(4)(1)"]
02:23.03 < GDJB3 OK Thread completed.
02:23.03 matched r'(?P<tag>GDJB\d+) (?P<type>[A-Z]+) (?P<data>.*)' => ('GDJB3', 'OK', 'Thread completed.')
[None]

...


02:59.22 > CNCF3 THREAD references UTF-8 (SEEN)
02:59.23 < * THREAD (3)(2)(4)(1)
02:59.23 matched r'\* (?P<type>[A-Z-]+)( (?P<data>.*))?' => ('THREAD', ' (3)(2)(4)(1)', '(3)(2)(4)(1)')
02:59.23 untagged_responses[THREAD] 0 += ["(3)(2)(4)(1)"]
02:59.23 < CNCF3 OK Thread completed.
02:59.23 matched r'(?P<tag>CNCF\d+) (?P<type>[A-Z]+) (?P<data>.*)' => ('CNCF3', 'OK', 'Thread completed.')
02:59.23 untagged_responses[THREAD] => ['(3)(2)(4)(1)']
['(3)(2)(4)(1)']


As you can see, the first is a UID command and the second is calling the thread method. Also, the server responses are the same for both. So why is one returning None and the other returning the correct response? I'm using python2.4 and I'm stuck with it as I'm using it in a zope environment.

Regards,
SZ

" life isn't heavy enough,it flies away and floats far above action"


Make Yahoo!7 your homepage and win a trip to the Quiksilver Pro. Find out more

Piers Lauder

unread,
Feb 3, 2009, 5:07:06 PM2/3/09
to python, Mr SZ
On Tue, 3 Feb 2009 05:22:01 -0800 (PST), Mr SZ wrote:
>
> I was looking at the thread functionality of IMAP4rev1 servers with the
> threading extension. Here is my output with debug=8 :
>
>
>
> 02:23.02 > GDJB3 UID THREAD references UTF-8 (SEEN)
> 02:23.02 < * THREAD (3)(2)(4)(1)
> 02:23.02 matched r'\* (?P<type>[A-Z-]+)( (?P<data>.*))?' => ('THREAD', ' (3)(2)(4)(1)', '(3)(2)(4)(1)')
> 02:23.03 untagged_responses[THREAD] 0 += ["(3)(2)(4)(1)"]
> 02:23.03 < GDJB3 OK Thread completed.
> 02:23.03 matched r'(?P<tag>GDJB\d+) (?P<type>[A-Z]+) (?P<data>.*)' => ('GDJB3', 'OK', 'Thread completed.')
> [None]
>
> ...
>
>
> 02:59.22 > CNCF3 THREAD references UTF-8 (SEEN)
> 02:59.23 < * THREAD (3)(2)(4)(1)
> 02:59.23 matched r'\* (?P<type>[A-Z-]+)( (?P<data>.*))?' => ('THREAD', ' (3)(2)(4)(1)', '(3)(2)(4)(1)')
> 02:59.23 untagged_responses[THREAD] 0 += ["(3)(2)(4)(1)"]
> 02:59.23 < CNCF3 OK Thread completed.
> 02:59.23 matched r'(?P<tag>CNCF\d+) (?P<type>[A-Z]+) (?P<data>.*)' => ('CNCF3', 'OK', 'Thread completed.')
> 02:59.23 untagged_responses[THREAD] => ['(3)(2)(4)(1)']
> ['(3)(2)(4)(1)']
>
>
> As you can see, the first is a UID command and the second is calling the
> thread method. Also, the server responses are the same for both. So why is
> one returning None and the other returning the correct response? I'm using
> python2.4 and I'm stuck with it as I'm using it in a zope environment.

In one of life's weird coincidences - someone else just created
bugs.python.org issue5146 on this.

The fix is a change in the method 'uid' to read:

...
if command in ('SEARCH', 'SORT', 'THREAD'):
name = command
else:
name = 'FETCH'
...


(Thanks to <abhi...@synovel.com>)

Piers Lauder

0 new messages