psf / psf/requests

cookies.py why replace escaped quote with nothing?

Open
#3,759 22 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
54.3k
Forks
10.4k
Avg merge
16h 43m
Merged PRs (30d)
3

Description

https://github.com/kennethreitz/requests/blob/master/requests/cookies.py#L346

Why do this? An escaped quote can be sent in the case of sending json in the cookie and this code mangles that json. I'm raising this because the http library seems to think that formatting the json this way on the server is the right way to do it. See http/cookies.py function _quote line 225 in my 3.4 version.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with requests/cookies.py at line 346 and compare its behavior with the Python 3.4 http/cookies.py _quote function at line 225. Review the issue discussion to determine whether escaped quotes should be preserved when JSON is sent in a cookie; done requires an agreed behavior and a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.