Bug: Windows upload helper should quote URL-derived remote paths
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
Línea de trabajo
Empieza por windows-release/merge-and-upload.py, especialmente por url2path, call_ssh, upload_ssh y el bucle de upload que prepara directorios y actualiza modos. Ejecuta el reproducer proporcionado e inspecciona cada comando SSH y SCP capturado. El trabajo estará terminado cuando las rutas remotas derivadas de URL se traten como datos de ruta en los comandos de directorio, upload, grupo y modo, con cobertura de regresión para el caso del punto y coma.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
windows-release/merge-and-upload.py converts installer metadata URLs from
__install__.json into remote filesystem paths. The resulting paths are then
used in SSH and SCP command arguments for directory creation, upload, group, and
mode updates.
The metadata is normally produced by the release process, but the URL-derived
path should still be treated as path data and quoted before it is passed through
remote command strings.
Reproducer
Run this from the repository root on the current base tree. It mocks the
subprocess boundary and does not contact the upload host:
import importlib.util
from pathlib import Path
script = Path("windows-release/merge-and-upload.py")
spec = importlib.util.spec_from_file_location("merge_and_upload_repro", script)
module = importlib.util.module_from_spec(spec)
try:
spec.loader.exec_module(module)
except SystemExit:
# The script exits when no local __install__.json files are present. The
# upload helper functions are already defined by that point.
pass
calls = []
def fake_run(*args, single_cmd=False):
calls.append(args)
return ""
module._run = fake_run
module.PLINK = "plink.exe"
module.PSCP = "pscp.exe"
module.UPLOAD_HOST = "downloads.example.org"
module.UPLOAD_USER = "release-manager"
module.NO_UPLOAD = False
module.LOCAL_INDEX = False
dest = module.url2path(
"https://www.python.org/ftp/python/3.14.0;touch marker/"
"python-3.14.0-amd64.exe"
)
# This matches the directory preparation code in the base upload loop.
destdir = dest.rpartition("/")[0]
module.call_ssh(f"mkdir {destdir} && chgrp downloads {destdir} && chmod a+rx {destdir}")
module.upload_ssh("python-3.14.0-amd64.exe", dest)
for call in calls:
print(call)
The captured commands include the URL-derived path without shell quoting:
('plink.exe', '-batch', 'release-manager@downloads.example.org', 'mkdir /srv/www.python.org/ftp/python/3.14.0;touch marker && chgrp downloads /srv/www.python.org/ftp/python/3.14.0;touch marker && chmod a+rx /srv/www.python.org/ftp/python/3.14.0;touch marker')
('pscp.exe', '-batch', 'python-3.14.0-amd64.exe', 'release-manager@downloads.example.org:/srv/www.python.org/ftp/python/3.14.0;touch marker/python-3.14.0-amd64.exe')
('plink.exe', '-batch', 'release-manager@downloads.example.org', 'chgrp downloads /srv/www.python.org/ftp/python/3.14.0;touch marker/python-3.14.0-amd64.exe && chmod g-x,o+r /srv/www.python.org/ftp/python/3.14.0;touch marker/python-3.14.0-amd64.exe')
The semicolon from the metadata URL remains shell syntax in the generated
directory, upload, group, and mode commands.
Expected behavior
Remote paths derived from installer metadata URLs should be quoted as path data
before they are used in SSH command strings or SCP remote path arguments.
- Lenguaje dominante
- Python
- Estrellas
- 61
- Forks
- 48
- Merge medio
- 1 h 22 min
- PR fusionados (30 d)
- 4
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de python/release-tools
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
python/release-tools#434 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 38/100
python/release-tools#417 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 68/100
python/release-tools#397 ·
-
bug
python/release-tools#286 · 1 asignado ·
-
enhancement
Dificultad 3/5 1-2 días Aptitud para principiantes 52/100
python/release-tools#285 ·
Todos los issues de python/release-tools
Issues similares
-
fix: inaccuracy ⚠️
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
uabrc/uabrc.github.io#1255 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
ethereum-optimism/factory#64 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
duckdb/duckdb-python#627 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
Add link for tutorial Abiertodocumentation
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
Qiskit/qiskit-addon-sqd#376 ·