netrc.py strips away valid backslash characters from tokens
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 36k
- PR merge metrics
- PR metrics pending
Description
Bug report
Commit https://github.com/python/cpython/commit/15409c720be0503131713e3d3abc1acd0da07378 to close PR https://github.com/python/cpython/pull/26330 introduced a regression in the stdlib netrc.py that causes backslashes to be stripped out of tokens. As an example, the password extracted from the following .netrc file
machine my.host.com login user password mypass\word
will be mypassword instead of mypass\word. Same behavior would happen for login or account tokens.
Your environment
- CPython versions tested on: >=3.11
- PR: gh-99088
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
The affected entry point is netrc.py in the standard library; compare the token parsing introduced by commit 15409c720be0503131713e3d3abc1acd0da07378 with the sample .netrc shown here. Confirm that login, account, and password tokens retain valid backslashes, using the sample as the regression check.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- authentication
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 25/100