Memory errors when using imaplib with large email attachments

Richard Walkington richard at stockcontrol.net
Tue Jul 22 07:53:36 EDT 2003


Hello,

I'm using python to connect to an IMAP server and download mail. When
downloading messages with large attachements (> 10MB) Python socket
module crashes with a memory error. Is there anything I can do about
this?

Below is the trace back from using the imaplib example program from
the documentation to download the mailbox in question.

Thanks in adavance,
Richard Walkington

Traceback (most recent call last):
  File "imap_test.py", line 8, in ?
    typ, data = M.fetch(num, '(RFC822)')
  File "c:\python23\lib\imaplib.py", line 417, in fetch
    typ, dat = self._simple_command(name, message_set, message_parts)
  File "c:\python23\lib\imaplib.py", line 1000, in _simple_command
    return self._command_complete(name, self._command(name, *args))
  File "c:\python23\lib\imaplib.py", line 830, in _command_complete
    typ, data = self._get_tagged_response(tag)
  File "c:\python23\lib\imaplib.py", line 931, in _get_tagged_response
    self._get_response()
  File "c:\python23\lib\imaplib.py", line 893, in _get_response
    data = self.read(size)
  File "c:\python23\lib\imaplib.py", line 231, in read
    return self.file.read(size)
  File "c:\python23\lib\socket.py", line 301, in read
    data = self._sock.recv(recv_size)
MemoryError




More information about the Python-list mailing list