473,387 Members | 1,585 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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.urlparse(uri)
netloc, path = url[1], url[2]
authHead = "Basic %s " % base64.encodestring("%s:%s"%(name, password))
conn = httplib.HTTPConnection(netloc)
conn.putrequest("GET", urllib.quote(path))
conn.putheader("Authorization", authHead)
conn.endheaders()
res = conn.getresponse()

if str(res.status)[:2] != '20':
conn.close()
raise ContentTransferError(res.status, 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
Jul 18 '05 #1
0 1896

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andy Rechenberg | last post by:
The problem is basically in the subject line. I am building an Intranet site based on Zope/CMF/Plone. In order to fulfill the requirements Zope/Python must be run on Windows. Zope is running...
11
by: Mike M | last post by:
Is it possible? In the parent process, I have a socket that binds, listens and then accepts new connections (which creates new sockets in the process). I want to be able to pass some of these new...
2
by: Sylvain Thenault | last post by:
Hi there ! I've noticed the following problem with python >= 2.3 (actually 2.3.4 and 2.4): syt@musca:test$ python Python 2.3.4 (#2, Sep 24 2004, 08:39:09) on linux2 Type "help", "copyright",...
4
by: Haim | last post by:
it is very strange for me that a simple event of closing socket that was in the the winsock object of vb6 , i didn't found yet in the vb.net the only way i found is to try to send something to...
0
by: Stephen G | last post by:
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...
10
by: John Nagle | last post by:
Here are three network-related exceptions. These were caught by "except" with no exception type, because none of the more specific exceptions matched. This is what a traceback produced: 1....
3
by: mandrews58 | last post by:
Hi there, I have a script which walks a directory and calculates the md5 digest on a bunch of large files (~1G). The first file found works fine, but the second generates a MemoryError: ...
2
by: Mirko Vogt | last post by:
Hey, it seems that the socket-module behaves differently on unix / windows when a timeout is set. Here an example: # test.py import socket...
1
by: keksy | last post by:
Hi every1, I am writing a small client/server application and in it I want to send an image asynchronous from the client to the server through a TCP socket. I found an example code on the MSDN...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.