Hi.

With my Trac 0.10.6 I am getting a reproduce-able error while uploading specific files as attachments to a ticket:

"SystemError: Objects/stringobject.c:3516: bad argument to internal function"

I have configured "[attachment] max_size" to be over 1 megabyte. And the problematic file is only 240KB.

Amazingly it seems to be the file contents which causes the error. A file filled with 240000 null-bytes causes the error. A file with 240000 random bytes does not:


Test with 240.000 zero bytes:
-> Upload as Trac-attachment -> ERROR

Test with 240.000 zero bytes,
but manually inserted a line-break in the middle of the file:
-> Upload as Trac-attachment -> OK

Test with 240.000 random bytes:
-> Upload as Trac-attachment -> OK

Test with 220.000 zero bytes:
-> Upload as Trac-attachment -> OK


Searching in the official Trac-Ticket database did not deliver anything.
Is there anybody else who can reproduce this problem with Trac 0.10 or maybe even with 0.11? If yes, then I would file a ticket for this.

This is how I made the test files:
dd if=/dev/zero of=zero_240000.test bs=1 count=240000
dd if=/dev/zero of=zero_220000.test bs=1 count=220000
dd if=/dev/urandom of=rand_240000.test bs=1 count=240000

My guess is that Trac is trying to read the large binary file line-by-line like a text file. If the line is getting too large (somewhere at 240.000 characters) then it fails.

As a workaround I can ZIP the problematic file(s).

Clemens

--
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en.

Reply via email to