[BUG]: Windows io.popen() handles lack lines(), breaking vfox-python installation

Aperta
#749 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
66/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go, lua
Ambito
backend, cli

Direzione di ricerca

Read internal/plugin/luai/exec.go around the Windows io.popen() override and compare its handle methods with GopherLua’s standard handle API. Add lines() behavior and coverage for line iteration, EOF, and Windows CRLF handling; run the relevant plugin tests. Done when Windows handles support the expected line iteration API and those cases pass.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

Description

Installing Python on Windows fails in the Python plugin's PostInstall hook because the Windows override of io.popen() returns a table with read, write, and close methods, but no lines method.

The Python installer downloads and extracts successfully. Installation then fails while enumerating the extracted MSI packages, before the MSI installation loop begins.

Environment

  • OS: Windows 10, build 19045, x64
  • Shell: Windows PowerShell 5.1
  • vfox: 1.0.13
  • vfox-python: 0.6.2
  • Requested Python version: 3.14.10

Steps to reproduce

With the Python plugin installed, run:

vfox install [email protected]

The relevant plugin code is:

local listing, listErr = io.popen(windowsCommand.files(msiPath))
-- ...
for file in listing:lines() do
    if file:match("%.msi$") then
        files[#files + 1] = file
    end
end

Actual behavior

Extracting installer...
Cleaning installer...
Installing python...
plugin [PostInstall] method error: <USERPROFILE>\.vfox\plugin\python\lib\util.lua:171: Failed to list installer packages: <USERPROFILE>\.vfox\plugin\python\lib\util.lua:161: attempt to call a non-function object
stack traceback:
        [G]: in function 'error'
        <USERPROFILE>\.vfox\plugin\python\lib\util.lua:171: in function 'windowsInstallExe'
        <USERPROFILE>\.vfox\plugin\python\lib\util.lua:68: in main chunk
        (tailcall): ?
        [G]: ?
failed to install python

Expected behavior

The Windows io.popen() handle should support handle:lines(), consistently with the standard GopherLua file/process handle API, so existing plugin code can enumerate the installer packages.

Source investigation

  • vfox 1.0.13 overrides io.popen() on Windows in internal/plugin/luai/exec.go. The returned table only defines read, write, and close.
  • The Python plugin calls listing:lines() in lib/util.lua.
  • Upstream GopherLua 1.1.1 registers a lines method for its standard file/process handles in iolib.go.

This appears to be an API compatibility gap in vfox's Windows override, rather than a PowerShell execution-policy or installer-download problem.

Verified local workaround

Replacing the Python plugin's listing:lines() loop with repeated listing:read("*l") calls resolves the installation failure. The surrounding protected read, pipe-close, exit-status, and empty-list checks were preserved, including rejecting partial results on read failure.

After this change:

  • Five isolated Lua cases passed using vfox plugin test: normal MSI enumeration/filtering, read failure after a partial list, empty list, nonzero listing-process exit code, and pipe-close failure.
  • A real vfox install [email protected] completed successfully.
  • The installed Python reported version 3.14.10; pip reported version 26.2.2.
  • Imports of ssl, sqlite3, ctypes, and tkinter succeeded.
  • Creating a virtual environment and running its Python and pip succeeded.

Could the Windows io.popen() override implement lines() and add coverage for line iteration, EOF, and Windows CRLF handling? That would fix the underlying incompatibility without requiring each affected plugin to add its own workaround.

Lingua principale
Go
Stelle
4k
Fork
167
Merge medio
1g 4h
PR unite (30g)
9

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di version-fox/vfox

Tutte le issue di version-fox/vfox

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.