MemoryError - IMAP retrieve self._sock.recv(recv_size)

2006-10-18 Thread Stephen G
Hi there.  I have been receiving MemoryErrors using the Windows version of 
Python 2.5.  The script I have written times the sending and the reception of 
emails with various attachments.

I get many exceptions when using the IMAP downloads.  This happens randomly; 
sometimes the file downloads OK, and other times no. 

Using an exception and traceback function, I can see the following...

MemoryError
no args
  File C:\Documents and Settings\root\Desktop\TMO\Python 
scripts\imap-v2.3a.py, line 263, in main
typ, data = M.fetch(num, '(RFC822)')

  File C:\Python25\lib\imaplib.py, line 437, in fetch
typ, dat = self._simple_command(name, message_set, message_parts)

  File C:\Python25\lib\imaplib.py, line 1055, in _simple_command
return self._command_complete(name, self._command(name, *args))

  File C:\Python25\lib\imaplib.py, line 885, in _command_complete
typ, data = self._get_tagged_response(tag)

  File C:\Python25\lib\imaplib.py, line 986, in _get_tagged_response
self._get_response()

  File C:\Python25\lib\imaplib.py, line 948, in _get_response
data = self.read(size)

  File C:\Python25\lib\imaplib.py, line 236, in read
return self.file.read(size)

  File C:\Python25\lib\socket.py, line 308, in read
data = self._sock.recv(recv_size)

Is this a know bug or is there something I can do to work around this?

Thanks,

Stephen


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: MemoryError - IMAP retrieve self._sock.recv(recv_size)

2006-10-18 Thread Stephen G
Fredrik,

Thanks for the response.  I did see that, but having been dated 2005 I thought 
that it might have been patched.  I am also sometimes getting the same problem 
with the urllib.py module.  T

his may have to do with the interaction between Python and the mobile 
optimization client that I am testing.  I do not see this problem when using 
Internet Explorer and the optimization client, nor is there a problem when 
using Python and no optimization client.  I am working with the optimization 
client vendor to have them test my Python script with their product.  This 
problem is intermittent with the optimization client which is annoying since 
most of the time it works.

Iteration Number 12
18/10/2006 14:01:23
Downloading http://tmotest.de/ftp/3MB.doc
Error: problem downloading 3MB.doc

error
no args
  File C:\Documents and Settings\root\Desktop\TMO\Python 
scripts\http-v2.3a.py, line 130, in main
urllib.urlretrieve(total_URL, downloaded_file)

  File C:\Python25\lib\urllib.py, line 89, in urlretrieve
return _urlopener.retrieve(url, filename, reporthook, data)

  File C:\Python25\lib\urllib.py, line 248, in retrieve
block = fp.read(bs)

  File C:\Python25\lib\socket.py, line 308, in read
data = self._sock.recv(recv_size)

I am hesitant to make any changes to the python libraries as I need to 
distribute these scripts with a standard Python install.  I guess an other 
option is to try and learn something like Perl and recode all the test 
scripts...
 


-- 
http://mail.python.org/mailman/listinfo/python-list