[Python-modules-team] Bug#801506: 413 Client Error: Request Entity Too Large on SSL site where curl works
Enrico Zini
enrico at debian.org
Sun Oct 11 12:24:18 UTC 2015
Package: python-requests
Version: 2.7.0-3
Severity: normal
Hello,
thank you for maintaining python requests.
When I run the attached script and test file, using python2 and python3,
I get:
$ ./test_post Traceback (most recent call last):
File "./test_post", line 33, in <module>
res.raise_for_status()
File "/usr/lib/python3/dist-packages/requests/models.py", line 851, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 413 Client Error: Request Entity Too Large
...but if I post it with curl, it works:
$ curl https://contributors.debian.org/contributors/test_post -F source=bugs.debian.org -F data=@test.json.xz -F data_compression=xz -k
{
"records_parsed": 30000,
"contributions_created": 0,
"code": 200,
"contributions_updated": 0,
"errors": [],
"identifiers_skipped": 0,
"contributions_processed": 0,
"records_skipped": 0,
"contributions_skipped": 0
}
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. 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].
Thank you,
Enrico
[1] https://wiki.debian.org/DebianSingleSignOn#Debian_SSO_documentation
[2] I have just implemented a test submission url on
contributors.debian.org and a random submission generator, so that I
could post this bug report: it was yak shaving morning
-- System Information:
Debian Release: stretch/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.2.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages python-requests depends on:
ii ca-certificates 20150426
ii python-chardet 2.3.0-1
ii python-urllib3 1.11-2
pn python:any <none>
python-requests recommends no packages.
Versions of packages python-requests suggests:
ii python-ndg-httpsclient 0.4.0-1
ii python-openssl 0.15.1-2
ii python-pyasn1 0.1.8-2
-- no debconf information
More information about the Python-modules-team
mailing list