[Mailman-Users] Mailman issue downloading full raw archive
Mark Sapiro
msapiro at value.net
Fri Nov 17 21:12:34 CET 2006
Jared Nyland wrote:
>
>Great Thanks for the help on this issue. I have added that code to my
>private.py and now I am getting this error.
>
>
>Traceback:
>
>Traceback (most recent call last):
> File "/usr/lib/mailman/scripts/driver", line 88, in run_main
> sys.__stdout__.write(tempstdout.getvalue())
>MemoryError
You can try the following change to /usr/lib/mailman/scripts/driver.
locate the code
try:
try:
sys.stderr = logger
sys.stdout = tempstdout
main()
sys.__stdout__.write(tempstdout.getvalue())
finally:
sys.stderr = sys.__stderr__
sys.stdout = sys.__stdout__
and change it to
try:
try:
sys.stderr = logger
sys.stdout = tempstdout
main()
tempstdout.seek(0)
line = tempstdout.readline()
while line:
sys.__stdout__.write(line)
line = tempstdout.readline()
finally:
sys.stderr = sys.__stderr__
sys.stdout = sys.__stdout__
This and the prior change are really only a stopgap. I now see the
issue is twofold. The output of the CGI is written to an in-memory
string and then ultimately copied to the real stdout. The base code
actually copies things in a way that at times there are two full
copies of the file in memory at once. These changes do the copy a line
at a time so that there is only one file copy in memory plus a line
which should avoid the problem for now, but eventually, the file will
grow large enough so that even one copy won't fit in memory, but
before that, perhaps the browsers receiving this file will choke.
--
Mark Sapiro <msapiro at value.net> The highway is for gamblers,
San Francisco Bay Area, California better use your sense - B. Dylan
More information about the Mailman-Users
mailing list