Strange behavior when setting cookie value to None in the method-level parameter
Open
Nobody has claimed this yet.
Bug
- Dominant language
- Python
- Stars
- 54.3k
- Forks
- 10.4k
- Avg merge
- 16h 43m
- Merged PRs (30d)
- 3
Description
After running the following code
s = requests.Session()
s.cookies.update({'from-my': 'browser'})
r = s.get('http://httpbin.org/cookies', cookies={'another': 'cookie', 'from-my': None})
print r.text
the output is
{
"cookies": {
"from-my; another": "cookie"
}
}
I used Python 2.7.6 and requests 2.7.0.
For more information, please see http://stackoverflow.com/questions/31902510/strange-requests-behavior-when-setting-cookie-value-to-none-in-the-method-level
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the Session request shown in the issue with requests 2.7.0 and inspect the cookie-handling path used by session cookies and the method-level cookies argument. Confirm the malformed cookie behavior and define the expected result for a None value before adding a regression test for the reported example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100