Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pod::Perldoc 3.2801 no longer includes the 'term' formatter class by default #16992

Open
p5pRT opened this issue May 9, 2019 · 3 comments
Open

Comments

@p5pRT
Copy link

p5pRT commented May 9, 2019

Migrated from rt.perl.org#134093 (status was 'open')

Searchable as RT134093$

@p5pRT
Copy link
Author

p5pRT commented May 9, 2019

From tlhackque@cpan.org

Created by tlhackque@cpan.org

Pod​::Perldoc 3.28 is the latest on CPAN, but 3.2801 is released
with the core. This "upgrade" contains a regression..

Prior to 3.2801 (corelist says this was released with 5.27.5),
perldoc would use terminal escape sequences to interpret Pod
formatting in most environments. (The exceptions being windows,
dos, (amiga), or terminal type dumb, emacs, none, or unknown)

With 3.2801, users of perldoc now see a text rendition of pod,
even when their terminal is capable of highlighting. This is
a regression. (I'm only noticing it now due to being late
upgrading Perl.)

The code change that caused this is in Pod​::Perldoc.pm​:

As far back as v3.24, the code was​:

sub init_formatter_class_list {
  my $self = shift;
  $self->{'formatter_classes'} ||= [];

  # Remember, no switches have been read yet, when
  # we've started this routine.

  $self->opt_M_with('Pod​::Perldoc​::ToPod'); # the always-there fallthru
  $self->opt_o_with('text');
  $self->opt_o_with('term') unless $self->is_mswin32 || $self->is_dos
  || !($ENV{TERM} && (
  ($ENV{TERM} || '') !~ /dumb|emacs|none|unknown/i
  ));

  return;
}

In 3.2801, the penultimate statement is missing​:

sub init_formatter_class_list {
  my $self = shift;
  $self->{'formatter_classes'} ||= [];

  # Remember, no switches have been read yet, when
  # we've started this routine.

  $self->opt_M_with('Pod​::Perldoc​::ToPod'); # the always-there fallthru
  $self->opt_o_with('text');
  <<< MISSING CODE HERE
  return;
}

The github repo (https://github.com/mrallen1/Pod-Perldoc)
does not contain 3.2801, so I don't know where this came from or
who to blame (in the friendly 'git' sense of the word).

I can think of no good reason for this change, so I presume it was
a merge error of some sort.

Please restore the original behavior. Here is my patch that does
that​:

Inline Patch
--- /opt/perlbrew/perls/perl-5.28.0/lib/5.28.1/Pod/Perldoc.pm~	2019-04-15 15:50:04.000000000 -0400
+++ /opt/perlbrew/perls/perl-5.28.0/lib/5.28.1/Pod/Perldoc.pm	2019-05-09 12:31:08.000000000 -0400
@@ -10,11 +10,11 @@
 use File::Spec::Functions qw(catfile catdir splitdir);

 use vars qw($VERSION @Pagers $Bindir $Pod2man
   $Temp_Files_Created $Temp_File_Lifetime
 );
-$VERSION = '3.2801';
+$VERSION = '3.280101';

 #..........................................................................

 BEGIN {  # Make a DEBUG constant very first thing...
   unless(defined &DEBUG) {
@@ -484,10 +484,15 @@
   # Remember, no switches have been read yet, when
   # we've started this routine.

   $self->opt_M_with('Pod::Perldoc::ToPod');   # the always-there fallthru
   $self->opt_o_with('text');
+  $self->opt_o_with('term')
+    unless $self->is_mswin32 || $self->is_dos || $self->is_amigaos
+	|| !($ENV{TERM} && (
+	       ($ENV{TERM} || '') !~ /dumb|emacs|none|unknown/i
+	    ));

   return;
 }

Thanks.
Perl Info

Flags:
    category=library
    severity=high
    module=Pod::Perldoc

Site configuration information for perl 5.28.1:

Configured by root at Mon Apr 15 14:14:18 EDT 2019.

Summary of my perl5 (revision 5 version 28 subversion 1) configuration:
   
  Platform:
    osname=linux
    osvers=2.6.22.14-100
    archname=i686-linux-thread-multi
    uname='linux overkill.sb.litts.net 2.6.22.14-100 #1 smp wed apr 8 18:07:54 edt 2015 i686 i686 i386 gnulinux '
    config_args='-de -Dprefix=/root/perl5/perlbrew/perls/perl-5.28.0 -Dusethreads -Aeval:scriptdir=/root/perl5/perlbrew/perls/perl-5.28.0/bin'
    hint=recommended
    useposix=true
    d_sigaction=define
    useithreads=define
    usemultiplicity=define
    use64bitint=undef
    use64bitall=undef
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
    bincompat5005=undef
  Compiler:
    cc='cc'
    ccflags ='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
    optimize='-O2'
    cppflags='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
    ccversion=''
    gccversion='8.1.0'
    gccosandvers=''
    intsize=4
    longsize=4
    ptrsize=4
    doublesize=8
    byteorder=1234
    doublekind=3
    d_longlong=define
    longlongsize=8
    d_longdbl=define
    longdblsize=12
    longdblkind=3
    ivtype='long'
    ivsize=4
    nvtype='double'
    nvsize=8
    Off_t='off_t'
    lseeksize=8
    alignbytes=4
    prototype=define
  Linker and Libraries:
    ld='cc'
    ldflags =' -fstack-protector-strong -L/usr/local/lib'
    libpth=/usr/local/lib /usr/local/lib/gcc/i686-pc-linux-gnu/8.1.0/include-fixed /usr/lib /lib
    libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
    perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    libc=libc-2.5.so
    so=so
    useshrplib=false
    libperl=libperl.a
    gnulibc_version='2.5'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs
    dlext=so
    d_dlsymun=undef
    ccdlflags='-Wl,-E'
    cccdlflags='-fPIC'
    lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector-strong'

Locally applied patches:
    Devel::PatchPerl 1.56


@INC for perl 5.28.1:
    /root/perl5/perlbrew/perls/perl-5.28.0/lib/site_perl/5.28.1/i686-linux-thread-multi
    /root/perl5/perlbrew/perls/perl-5.28.0/lib/site_perl/5.28.1
    /root/perl5/perlbrew/perls/perl-5.28.0/lib/5.28.1/i686-linux-thread-multi
    /root/perl5/perlbrew/perls/perl-5.28.0/lib/5.28.1
    /root/perl5/perlbrew/perls/perl-5.28.0/lib/site_perl/5.28.0
    /root/perl5/perlbrew/perls/perl-5.28.0/lib/site_perl


Environment for perl 5.28.1:
    HOME=/root
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/root/perl5/perlbrew/bin:/root/perl5/perlbrew/perls/perl-5.28.0/bin:/root/bin:/usr/lib/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib/ccache:/usr/local/pgsql/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin
    PERLBREW_HOME=/root/.perlbrew
    PERLBREW_MANPATH=/root/perl5/perlbrew/perls/perl-5.28.0/man
    PERLBREW_PATH=/root/perl5/perlbrew/bin:/root/perl5/perlbrew/perls/perl-5.28.0/bin
    PERLBREW_PERL=perl-5.28.0
    PERLBREW_ROOT=/root/perl5/perlbrew
    PERLBREW_SHELLRC_VERSION=0.86
    PERLBREW_VERSION=0.86
    PERL_BADLANG (unset)
    SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented May 9, 2019

From @khwilliamson

On Thu, 09 May 2019 09​:37​:10 -0700, tlhackque@​cpan.org wrote​:

This is a bug report for perl from tlhackque@​cpan.org,
generated with the help of perlbug 1.41 running under perl 5.28.1.

-----------------------------------------------------------------
[Please describe your issue here]
Pod​::Perldoc 3.28 is the latest on CPAN, but 3.2801 is released
with the core. This "upgrade" contains a regression..

Prior to 3.2801 (corelist says this was released with 5.27.5),
perldoc would use terminal escape sequences to interpret Pod
formatting in most environments. (The exceptions being windows,
dos, (amiga), or terminal type dumb, emacs, none, or unknown)

With 3.2801, users of perldoc now see a text rendition of pod,
even when their terminal is capable of highlighting. This is
a regression. (I'm only noticing it now due to being late
upgrading Perl.)

The code change that caused this is in Pod​::Perldoc.pm​:

The change was intentional, and due to issues with the highlighting

commit f2ee4cb
Author​: Zefram <zefram@​fysh.org>
Date​: Sat Oct 7 05​:17​:19 2017 +0100

  customise Pod​::Perldoc to fix output misbehaviour
 
  Pod​::Perldoc has, since version 3.20, exhibited various kinds of
  misbehaviour relating to a bad default choice of formatter. Output has
  sometimes appeared mangled due to the newly-default formatter emitting
  unportable escape sequences, and sometimes there has been a more
  severe output failure due to perldoc making unportable changes to pager
  configuration in an attempt to make the escape sequences work. This is
  discussed in [perl #131762]. In the upstream instance of the module
  there have been tweaks to the unportable behaviour, but not an actual fix.
 
  In order to make the core distro ship a reliably-working version of
  perldoc, this patch customises Pod​::Perldoc to implement the obvious
  fix for the portability problems. The fixed version defaults to the
  ToText formatter, which produces properly plain text that will go through
  any pager. It never attempts any change to pager configuration.

Thus the blead version opts to output plain text which is viewable everywhere because there were problems on some devices with highlighting.

I doubt that we will revert this commit unless the issues in [perl #131762] get fixed first.

--
Karl Williamson

@p5pRT
Copy link
Author

p5pRT commented May 9, 2019

The RT System itself - Status changed from 'new' to 'open'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants