FAQ

On Wednesday, April 2, 2003, at 03:00 PM, Jarkko Hietaniemi wrote:
==== //depot/perl/ext/Encode/t/enc_module.t#6 (text) ====
Index: perl/ext/Encode/t/enc_module.t
--- perl/ext/Encode/t/enc_module.t#5~19100~ Mon Mar 31 02:03:50 2003
+++ perl/ext/Encode/t/enc_module.t Tue Apr 1 20:42:40 2003
@@ -38,6 +38,7 @@
print $obj->str, "\n";
$obj->set("¥Æ¥¹¥Èʸ»úÎó");
print $obj->str, "\n";
+close STDOUT;

my $cmp = compare_text($file0, $file1);
is($cmp, 0, "encoding vs. STDOUT");
@@ -51,7 +52,6 @@
is ($cmp[$i++], $_, "encoding vs. STDIN - $i");
}

-close STDOUT;
unlink $file1 unless $cmp;
__END__
This is HOW IT WAS USED TO BE until Encode 1.92. But Enache found this
causes problem with FreeBSD4+thread so he first deleted "close STDOUT"
but I told it it would break Win32 because Win32 does not allow you to
unlink open files.
! t/enc_module.t AUTHORS
failure with threaded Perl on FreeBSD addressed.
Enache Adrian <enache@rdslink.ro> is added to AUTHORS for this.
Message-Id: <20030322230131.GA813@ratsnest.hole>
Please give me some time to come up with something elegant; I'm still
under the influence of pollen allergy....

Dan the Encode Maintainer

Search Discussions

  • Enache Adrian at Apr 5, 2003 at 6:48 pm

    On Sun, Apr 06, 2003 at 12:28:16AM +0900, Dan Kogai wrote:
    This is HOW IT WAS USED TO BE until Encode 1.92. But Enache found this
    causes problem with FreeBSD4+thread so he first deleted "close STDOUT"
    FreeBSD 5.0 / user-threads (libc_r.so) in fact. According to
    Jos Boumans, it works fine with FreeBSD 4.x. And probably using
    the rfork-based linuxthreads or the new libthr will make it
    work fine too ( I'll try the latest when I have enough time )
    but I told it it would break Win32 because Win32 does not allow you to
    unlink open files.
    Should make it a TODO test be politically correct ?
    That will give the impression that the failure is related to Encode
    which in fact it isn't.

    or just this:
    -----------------------------------------------------------------------
    --- /arc/perl/ext/Encode/t/enc_module.t Wed Apr 2 08:55:40 2003
    +++ perl/ext/Encode/t/enc_module.t Sat Apr 5 21:42:08 2003
    @@ -38,7 +38,8 @@
    print $obj->str, "\n";
    $obj->set("¥Æ¥¹¥Èʸ»úÎó");
    print $obj->str, "\n";
    -close STDOUT;
    +close STDOUT unless $^O eq 'freebsd';
    + # weird bug in FreeBSD5.0/user-threads (libc_r.so)

    my $cmp = compare_text($file0, $file1);
    is($cmp, 0, "encoding vs. STDOUT");
    -----------------------------------------------------------------------

    Regards
    Adi
  • Nicholas Clark at Apr 6, 2003 at 4:06 pm

    On Sat, Apr 05, 2003 at 09:37:24PM +0300, Enache Adrian wrote:

    FreeBSD 5.0 / user-threads (libc_r.so) in fact. According to
    Jos Boumans, it works fine with FreeBSD 4.x. And probably using
    the rfork-based linuxthreads or the new libthr will make it
    work fine too ( I'll try the latest when I have enough time )
    Should make it a TODO test be politically correct ?
    That will give the impression that the failure is related to Encode
    which in fact it isn't.
    -close STDOUT;
    +close STDOUT unless $^O eq 'freebsd';
    + # weird bug in FreeBSD5.0/user-threads (libc_r.so)
    Eeugh. Because

    1: From your description it's a bug in FreeBSD, isn't it? In which case it
    will probably get fixed at some point. So maybe it should be a TODO.

    except that

    2: If it's a TODO on FreeBSD then it might pass on the other two thread
    implementations you describe, and hence be a TODO test that unexpectedly
    passes. (Which is also bad, IIRC)

    but can we detect what sort of threads FreeBSD has from %Config::Config?

    And is the only problem about this about open files and Win32? The close
    isn't actually part of the Encode functionality that we're testing, is it?
    So maybe it's not actually enough merit to be a TODO, and the close STDOUT
    is conditional on $^O just as you suggest.

    Doing that is faster than reading this message, let alone trying to make
    sense of it. :-)

    Nicholas Clark

    PS This message supplied without warranty of any form, particularly
    suitability for any purpose, including but not limited to making sense,
    or furthering the development of perl. Use at your own risk. May contain
    traces of nuts. Your sanity will be at risk if you fail to make payments
    on debts secured against it.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupperl5-porters @
categoriesperl
postedApr 5, '03 at 3:28p
activeApr 6, '03 at 4:06p
posts3
users3
websiteperl.org

People

Translate

site design / logo © 2022 Grokbase