Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Vendored PyPI revert drift warnings print the ledger key in Rust debug form: `Pipfile.lock entry for Some("default:six") changed since vendoring`

Offen Anfängerfreundlich
#1,608 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
78/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
rust
Bereich
tooling

Rechercherichtung

Die fehlerhafte Ausgabe entsteht durch die {:?}-Formatierung des Option<String>-Schlüssels in WiringRecord::key (crates/socket-patch-core/src/vendor/state.rs), der in pypi_pipenv.rs (vendor_lock_entry_drifted) und pypi_requirements.rs (vendor_revert_line_drifted) verwendet wird, mit demselben Muster in pypi_uv.rs und common.rs. Beginne damit, diese vier Aufrufstellen und die bestehende Warnung vendor_revert_residual_reference zu lesen, die Schlüssel bereits unformatiert ausgibt. Fertig ist, wenn die Drift-Warnungen den reinen Schlüssel oder einen Platzhalter für None ausgeben und die Revert-/Rollback-Tests weiterhin bestehen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

agent:triaged bug bughunt pm:pipenv priority:p1

[agent] Found by the scheduled Pipenv bug-hunt routine (ledger #313).

Summary

When a vendored Pipenv project's recorded wiring has drifted, vendor --revert, remove and rollback warn with the ledger key formatted through {:?} on an Option<String>. The warning, in both human output and --json warning text, shows a Rust Some("…") wrapper instead of the key:

Warning: Pipfile.lock entry for Some("default:six") changed since vendoring; left untouched
Warning: requirements.txt: the vendor line for Some("requirements.txt:1") changed since vendoring; left untouched

Impact

This is cosmetic only. The keep/restore behaviour is correct, nothing is unpatched silently, and VEX isn't affected. But the debug form leaks into user-facing text and into the --json warning messages that CI consumers read. When the key is missing (None, e.g. an older or hand-written ledger), the warning would print entry for None.

Repro (Linux, main 657fce2 / 5.0.1, real Pipenv 2026.9.1, local mock of the patch API serving a patched six-1.16.0 wheel)

cat > Pipfile <<'EOF'
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
six = "==1.16.0"

[requires]
python_version = "3.11"
EOF
pipenv lock
socket-patch scan --mode vendored --yes          # Pipfile.lock six → ./.socket/vendor/pypi/<uuid>/six-…whl
# drift the vendored entry (any field the ledger recorded, e.g. its markers)
sed -i "s/python_version >= '2.7' and/python_version >= '2.8' and/" Pipfile.lock
socket-patch vendor --revert --yes               # Warning: Pipfile.lock entry for Some("default:six") changed since vendoring; left untouched
socket-patch rollback --yes --json | grep -o 'entry for Some[^;]*'   # entry for Some(\"default:six\") changed since vendoring

The requirements.txt variant: vendor with a sibling requirements.txt holding six==1.16.0, then hand-restore that line (or interrupt a remove with SIGKILL after it restored requirements.txt but before it dropped the ledger) and re-run vendor --revert. It prints the vendor line for Some("requirements.txt:1") changed since vendoring.

Expected vs actual

  • Expected: the warning names the entry as the ledger records it (Pipfile.lock entry for default:six …, the vendor line for requirements.txt:1 …). Other warnings in the same code path print keys plainly, e.g. the vendor_revert_residual_reference text.
  • Actual: Some("default:six") / Some("requirements.txt:1").

OS × version

OS Pipenv vendor --revert rollback remove
Linux 2026.9.1 reproduces (×2) reproduces (×2) reproduces (requirements.txt variant)
macOS / Windows not probed: the string formatting is platform-independent

No bisect, because the format strings predate the current history.

Suspect code

WiringRecord::key is Option<String> (crates/socket-patch-core/src/vendor/state.rs:143), and these format it with {:?}:

  • crates/socket-patch-core/src/vendor/pypi_pipenv.rs:569 (vendor_lock_entry_drifted)
  • crates/socket-patch-core/src/vendor/pypi_requirements.rs:601 (vendor_revert_line_drifted)
  • the same pattern at crates/socket-patch-core/src/vendor/pypi_uv.rs:991 and crates/socket-patch-core/src/vendor/common.rs:826 (not exercised here; they likely show the same leak for uv and the other common.rs users)

A fix along the lines of rec.key.as_deref().unwrap_or("<unknown>") with {} would cover all four.

Vorherrschende Sprache
Rust
Sterne
8
Forks
1
Ø Merge
16 Std. 19 Min.
Gemergte PRs (30 T.)
586

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus SocketDev/socket-patch

Alle Issues in SocketDev/socket-patch

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

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