Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On Python 3, sending bytes automatically choses 'x-www-form-urlencoded' as the content_type #2071

Closed
miracle2k opened this issue May 27, 2014 · 2 comments · Fixed by #2072
Closed

Comments

@miracle2k
Copy link

Is this on purpose. I would have assumed bytes to mean "send this unknown chunk of data as-is".

@sigmavirus24
Copy link
Contributor

@Lukasa this is the actual behaviour. I tested on Python 2 and 3 and this only happens on Python 3 due to these lines I'm pretty sure we don't want this behaviour by default. I'm going to work on this some tonight and post my progress before heading to sleep.

sigmavirus24 added a commit to sigmavirus24/requests that referenced this issue May 28, 2014
@sigmavirus24
Copy link
Contributor

#2072 fixes this issue. Thanks for reporting it @miracle2k! 🍰

openstack-gerrit pushed a commit to openstack/openstack that referenced this issue Jun 13, 2017
Project: openstack/python-swiftclient  74eb91b176464dcac225e7b8152e3a933fdf30ee

Do not set Content-Type to '' with new requests.

Previously, python-swiftclient worked around a requests issue where
Content-Type could be set to application/x-www-form-urlencoded when
using python3. This issue has been resolved and a fix released in
requests 2.4 (fixed in subsequent releases as well). The patch makes
the workaround conditional on the requests version, so that with
sufficiently new requests libraries, the Content-Type is not set.

For reference, requests 2.4 was released August 29th, 2014. The
specific issue filed in the requests tracker is:
psf/requests#2071.

Related-Change: I035f8b4b9c9ccdc79820b907770a48f86d0343b4
Closes-Bug: #1433767

Change-Id: Ieb2243d2ff5326920a27ce8c3c6f0f5c396701ed
openstack-gerrit pushed a commit to openstack/python-swiftclient that referenced this issue Jun 13, 2017
Previously, python-swiftclient worked around a requests issue where
Content-Type could be set to application/x-www-form-urlencoded when
using python3. This issue has been resolved and a fix released in
requests 2.4 (fixed in subsequent releases as well). The patch makes
the workaround conditional on the requests version, so that with
sufficiently new requests libraries, the Content-Type is not set.

For reference, requests 2.4 was released August 29th, 2014. The
specific issue filed in the requests tracker is:
psf/requests#2071.

Related-Change: I035f8b4b9c9ccdc79820b907770a48f86d0343b4
Closes-Bug: #1433767

Change-Id: Ieb2243d2ff5326920a27ce8c3c6f0f5c396701ed
openstack-gerrit pushed a commit to openstack/openstack that referenced this issue Jun 13, 2017
Project: openstack/python-swiftclient  74eb91b176464dcac225e7b8152e3a933fdf30ee

Do not set Content-Type to '' with new requests.

Previously, python-swiftclient worked around a requests issue where
Content-Type could be set to application/x-www-form-urlencoded when
using python3. This issue has been resolved and a fix released in
requests 2.4 (fixed in subsequent releases as well). The patch makes
the workaround conditional on the requests version, so that with
sufficiently new requests libraries, the Content-Type is not set.

For reference, requests 2.4 was released August 29th, 2014. The
specific issue filed in the requests tracker is:
psf/requests#2071.

Related-Change: I035f8b4b9c9ccdc79820b907770a48f86d0343b4
Closes-Bug: #1433767

Change-Id: Ieb2243d2ff5326920a27ce8c3c6f0f5c396701ed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants