Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

fix: support filehandles in bundled Tie::File

Chiusa
#1,578 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Una pull request collegata è già stata integrata.

  • #1673 di @fglock — integrata

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
perl
Ambito
tooling

Direzione di ricerca

Start by locating the bundled Tie::File implementation and tracing how its second argument is stored, tested, and opened. Add a tracked regression test for tying an array to a writable filehandle, then run t/01_csv.t and t/02_cmData.t for AI::ConfusionMatrix on both the JVM and Interpreter backends; done means the filehandle form works and the upstream suite passes.

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

Descrizione

bug

Summary

AI::ConfusionMatrix 0.010 cannot read CSV output through the bundled Tie::File when the caller supplies an open filehandle. Upstream Tie::File accepts this supported usage, but PerlOnJava's bundled shim treats the handle as a filename and produces an empty tied array.

CPAN evidence

Archived CPAN random-tester run 20260930-095822-89295 reported AI::ConfusionMatrix as FAIL:

  • t/01_csv.t: 12 of 13 assertions fail; all expected CSV lines are undef
  • t/02_cmData.t: passes

The relevant upstream suite passes unchanged under system Perl: 2 files and 19 tests, all successful.

The focused failing test reproduces on both PerlOnJava execution backends:

  • JVM backend: 12 of 13 assertions fail
  • Interpreter backend: 12 of 13 assertions fail

Minimal behavior difference

use Tie::File;
use File::Temp 'tempfile';

my $fh = tempfile();
print {$fh} "x\n";
tie my @lines, 'Tie::File', $fh or die $!;
print defined $lines[0] ? $lines[0] : 'undef', "\n";

System Perl prints x; both PerlOnJava backends print undef.

Likely cause

The bundled Tie::File implementation stores its second argument as filename and subsequently applies file tests and open to it. It needs to preserve upstream behavior when that argument is an already-open filehandle.

This distribution is pure Perl; no XS/native port or environmental prerequisite is involved.

Acceptance

  • Support tying Tie::File arrays to writable filehandles as well as pathnames.
  • Add a tracked regression test covering the filehandle form.
  • Verify the upstream AI::ConfusionMatrix CSV suite on both PerlOnJava backends.
Lingua principale
Perl
Stelle
64
Fork
7
Merge medio
5h 7m
PR unite (30g)
201

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 fglock/PerlOnJava

Tutte le issue di fglock/PerlOnJava

Issue simili

Altre issue su Perl

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.