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 0 1913 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 as a Wi32 service. When the python.exe process
consume ~122MB (according to the Windows Task Manager) I start
receiving MemoryError: out of memory exceptions. I've already checked
for bad RAM and the server's RAM appears good.
|
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 sockets to
a spawned process. Is it possible, and if so how?
Any help is much appreciated!!
Mike
|
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", "credits" or "license" for more information.
>>> import parser
>>> parser.suite('# -*- coding: IBO-8859-1 -*-')
|
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 the socket and if i got
error then the socket is closed.
there must be a way to get this event without trying to send something ,
since it is in the lower level
|
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 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...
| |
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. File "D:\Python24\lib\socket.py", line 295, in read
data = self._sock.recv(recv_size)
timeout: timed out
|
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:
Traceback (most recent call last):
File "t2.py", line 70, in <module>
walk_dirs(sys.argv)
File "t2.py", line 53, in walk_dirs
actual = calculate_digest(datafile)
File "t2.py", line 28, in calculate_digest
|
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
sock=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
print 'trying to connect...'
|
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 site, which is actually
for sending strings. I tried to adapt this code so that the client
sends an image instead of a string. However, there is something wrong
on the server side (i guess)...
The server starts listening, the client starts sending...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |