[Python-modules-team] Bug#801506: 413 Client Error: Request Entity Too Large on SSL site where curl works

Daniele Tricoli eriol at mornie.org
Wed Oct 14 22:59:04 UTC 2015


Hello Enrico,
many thanks for your report!

On Sunday, October 11, 2015 02:24:18 PM Enrico Zini wrote:
> When I run the attached script and test file, using python2 and python3,
> I get:
[CUT traceback and curl example]

It seems that the attachment was lost, please can you send it again?
I tried with an empty data file but it's not enough to replicate this bug.

This is my test script:

-------------------------8<------------------------------------------------
import requests

url = 'https://contributors.debian.org/contributors/test_post'
files = {'data': open('test.json.xz', 'rb')}
payload = {'source': 'bugs.debian.org', 'data_compression': 'xz'}

if __name__ == '__main__':
    r = requests.post(url, files=files, data=payload)
    print(r.text)
-------------------------8<------------------------------------------------

> I suspect that python-requests is getting confused with ssl
> renegotiation that was introduced when we implemented client certificate
> authentication[1], although it's hard for me to track that down.

Many thanks for the hint, I will also ask to upstream developers: they are 
very supportive so I hope we will have a solution soon. 

> The best I can do is to provide a test case for reproducing the behaviour,
> that does not require any debian credentials to be run[2].

This is really appreciated, thanks! I have already used it to wrote my test 
script. And I will use again for testing.

I have quite completed the packaging requests 2.8.1-1, but I'm waiting for the 
upload of python-urllib3 1.12-1: I'm sorry for the delay, but although I'm a 
DM since September, my usual sponsor had problems giving me upload permissions 
using dcut.

I will try your test case both with requests 2.7.0-3 and 2.8.1-1.

Kind regards,

-- 
 Daniele Tricoli 'eriol'
 https://mornie.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.alioth.debian.org/pipermail/python-modules-team/attachments/20151015/4f06727a/attachment.sig>


More information about the Python-modules-team mailing list