MemoryError in socket.py on Windows XP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jamie

    #1

    MemoryError in socket.py on Windows XP

    Hi all,

    I have a Python 2.3.2 application that uses the httplib package to download
    files. On Windows XP only, I'm getting a MemoryError exception in the socket
    module when files are around 2.8 MB in size. This is on a PC with 500MB of
    RAM, so memory shouldn't be an issue.

    Here's the portion of code leading up to the error that is doing the
    download:

    url = urlparse.urlpar se(uri)
    netloc, path = url[1], url[2]
    authHead = "Basic %s " % base64.encodest ring("%s:%s"%(n ame, password))
    conn = httplib.HTTPCon nection(netloc)
    conn.putrequest ("GET", urllib.quote(pa th))
    conn.putheader( "Authorization" , authHead)
    conn.endheaders ()
    res = conn.getrespons e()

    if str(res.status)[:2] != '20':
    conn.close()
    raise ContentTransfer Error(res.statu s, res.reason, None)

    data = res.read()

    The exception is thrown in line 301 of socket.py on the line:

    data = self._sock.recv (recv_size)

    Are there any gotchas with XP that I should be aware of? Are there any extra
    headers that I should be including here?

    Many thanks,

    Jamie


Working...