dagolden / Capture-Tiny

(Perl) Capture STDOUT and STDERR from Perl, XS or external programs
http://search.cpan.org/dist/Capture-Tiny/
39 stars 19 forks source link

Do not try to restore what we didn't save earlier #42

Closed ribasushi closed 8 years ago

ribasushi commented 8 years ago

This is the most minimal fix for https://github.com/dagolden/Capture-Tiny/issues/22. The minimal reproduction on any 5.8.x is:

$ perl -It/lib -MUtils -e 'save_std("stdin"); restore_std("stdout")' < /dev/null

It fails due to how the "never saved restore" behaves given differences in autovivification. I think the real problem is that it is silent on 5.10+ and the real fix is to make sure restore_std croaks when trying to restore things it never saved in the first place.

Feel free to reject this PR and implement the more involved fix.

ribasushi commented 8 years ago

#cpantesters_20160523.log:[17:46:58] * GumbyNET7 CPAN Upload: Capture-Tiny-0.40 by DAGOLDEN http://metacpan.org/release/DAGOLDEN/Capture-Tiny-0.40

😢

xdg commented 8 years ago

Cherry picked to master and released as 0.41-TRIAL to CPAN.

(No point making the last -TRIAL wait longer before stable release; ping me in a week if I haven't shipped this stable.)

ribasushi commented 8 years ago

No point making the last -TRIAL wait longer before stable release

Concur. Thanks for looking into this!

xdg commented 8 years ago

Released to CPAN as 0.42