develooper Front page | perl.perl5.porters | Postings from July 2013

[perl #118821] lib/perl5db.t loads Term::ReadLine::Gnu from system installation

From:
Petr Pisar
Date:
July 9, 2013 11:56
Subject:
[perl #118821] lib/perl5db.t loads Term::ReadLine::Gnu from system installation
Message ID:
rt-3.6.HEAD-2552-1373370979-78.118821-75-0@perl.org
# New Ticket Created by  Petr Pisar 
# Please include the string:  [perl #118821]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=118821 >


Running perl-5.18.0 tests while older perl (e.g. 5.16.3) is installed can leak
not-just-built modules from older Perl system installation into running tests.

E.g. if you have Term::ReadLine::Gnu installed in the include paths, 5.18.0
lib/perl5db.t will load it via Term::ReadLine and consequitive
Term::ReadLine::Gnu initialization will fail:

../lib/perl5db.t .. 1/113 Cannot do `initialize' in Term::ReadLine::Gnu at ../lib/perl5db.pl line 6813.
 at /usr/lib64/perl5/vendor_perl/Term/ReadLine/Gnu.pm line 716.

Minimal reproducer is:

$ LD_PRELOAD=../libperl.so ./perl -I../lib -e 'use Term::ReadLine; Term::ReadLine->new(q{foo})'
Cannot do `initialize' in Term::ReadLine::Gnu at -e line 1.

I tried to remove the standard directories from @INC at various places
(t/harness, TestInit.pm, lib/perl5db.pl, lib/perl5db.t) to but without a luck.

Attached patch sets PERL_RL in lib/perl5db.t to favour pure-Perl
Term::ReadLine implementation that is part of core to prevent from loading the
Term::ReadLine::Gnu.

-- Petr



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About