[Python-bugs-list] A little bug in the ._test of the mailbox module (PR#135)

leroy@iupchbio.univ-nantes.fr leroy@iupchbio.univ-nantes.fr
Tue, 23 Nov 1999 11:15:58 -0500 (EST)


Full_Name: LEROY Regis
Version: 1.5
OS: Linux RH 6.1
Submission from: helios.iupchbio.sciences.univ-nantes.fr (193.52.108.130)


I were trying to understand the not so well docummented mailbox module.
I've test it with is _test function and I've seen this bug:.
>>/test.py /var/spool/mail/leroy 2
Message 2 body:
Traceback (innermost last):
  File "./test.py", line 13, in ?
    mb = mailbox._test()
  File "/usr/lib/python1.5/mailbox.py", line 263, in _test
    msg.rewindbody()
  File "/usr/lib/python1.5/rfc822.py", line 104, in rewindbody
    self.fp.seek(self.startofbody)
AttributeError: 'None' object has no attribute 'seek'

This is due to the line 258 of mailbox.py. In this line we've got "msg.fp =
None"
(I can't understan why...)
So in rfc822 when we make the self.fp.seek fp is None. There is an easy
solution
which is to comment the line 258 in mailbox.py. I think this should be
important
for such module. I think it could be important as well to make it more clear, 
using some documentation strings and talking about the rfc822 msg format.

That's all, python is nice langage but geeks are geeks...