python / python/cpython

netrc.py strips away valid backslash characters from tokens

Offen
#99,080 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

stdlib type-bug
Vorherrschende Sprache
Python
Sterne
77.2k
Forks
36k
PR-Merge-Kennzahlen
PR-Kennzahlen ausstehend

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Der betroffene Einstiegspunkt ist netrc.py in der Standardbibliothek; vergleiche das durch den Commit 15409c720be0503131713e3d3abc1acd0da07378 eingeführte Token-Parsing mit dem hier gezeigten Beispiel .netrc. Bestätige, dass die login-, account- und password-Tokens gültige Backslashes beibehalten, und verwende das Beispiel als Regressionstest.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
authentication
Issue-Typ
Bug
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.