poplib.POP3.list() returns extra value?

S

Steve Greenland

For the poplib.POP3 object, docs say:

list([which])
Request message list, result is in the form (response, ['mesg_num octets',
...]). If which is set, it is the message to list.


But (I've folded the long line):

Python 2.3.5 (#2, May 4 2005, 08:51:39)
[GCC 3.3.5 (Debian 1:3.3.5-12)] on linux2
Type "help", "copyright", "credits" or "license" for more information.('+OK', ['1 2680', '2 2720', '3 9996', '4 23368', '5 2267', '6 2661', '7
4925', '8 2548', '9 10114', '10 1850', '11 14239', '12 6678', '13 6592',
'14 10011', '15 3554', '16 5764', '17 5080', '18 9998', '19 2056', '20
6354', '21 3031', '22 2868', '23 6325', '24 2566', '25 4827', '26 2995',
'27 2963', '28 2548', '29 9138', '30 2408', '31 2245', '32 2547', '33
2439', '34 9816', '35 2584', '36 10259', '37 1997', '38 4930', '39
1859', '40 9105', '41 6649', '42 6776', '43 2338', '44 17808', '45
4960', '46 1785', '47 2123', '48 2011', '49 9124', '50 1910', '51 1307',
'52 18869', '53 2507', '54 19099', '55 2328', '56 2069', '57 1654', '58
2346', '59 2891', '60 1865', '61 9334'], 548)
Note the trailing ", 548". By symmetry with the POP3.retr() function,
I'll guess that it's the number of octets in the response; it gets
bigger with more messages. I've tried this against three different
servers (popa3d, some version of Exchange, whatever's on RedHat 7.2),
and two versions of python (2.3.5 on Debian sarge, 2.2 on AIX 5.1) and
it's the same on all of them.

It could be that I'm insane, but I'd prefer to believe this is a doc
error that no one ever noticed because everybody uses POP3.list()[1].
You be the judge!

Steve
 
J

Jeff Epler

With a judicious bit of UTSL, that count seems to be the total number of
octets in the reply. This information comes from any user of
_getlongresp(), which actually returns a tuple (resp, list, octets).
These methods would be:
list
retr
top
uidl

I'd consider it a doc bug too. If you feel comfortable doing it, dive
in and improve the documentation of poplib. Submitting a patch to the
patch tracker on sf.net/projects/python is probably the best way to do
this, if you have the necessary knowledge of cvs to produce a patch.

Jeff

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFC6WZrJd01MZaTXX0RAjaTAJ4wSSuByr3osTMRalD8Pl+YVcQDdQCfRSdf
LQ3n7kB6yZS2urIsiL0pw1A=
=s+8Y
-----END PGP SIGNATURE-----
 
S

Steve Greenland

According to Jeff Epler said:
I'd consider it a doc bug too. If you feel comfortable doing it, dive
in and improve the documentation of poplib. Submitting a patch to the
patch tracker on sf.net/projects/python is probably the best way to do
this, if you have the necessary knowledge of cvs to produce a patch.

Knowledge: yes; Time: maybe. If someone else gets there first, I won't
be offended :)

Thanks for confirming...

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top