Skip Menu |

This queue is for tickets about the MIME-tools CPAN distribution.

Report information
The Basics
Id: 66286
Status: resolved
Priority: 0/
Queue: MIME-tools

People
Owner: Nobody in particular
Requestors: michiel.beijen [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 5.501
Fixed in: (no value)



Subject: Test failing on Win32 / Perl 5.12.3
On Win32 with StrawberryPerl 5.12.3; some of the attachment-filename-encoding tests are failing: # Looks like you planned 7 tests but ran 5. # Looks like your test exited with 2 just after 5. t/attachment-filename-encoding.t .. Dubious, test returned 2 (wstat 512, 0x200) Failed 2/7 subtests The issues I had are similar to this report: http://www.cpantesters.org/cpan/report/fa0ca556-41e3-11e0-bc89-b46c0e368d9a If you would like me to test anything, please let me know.
On Tue Mar 01 09:13:36 2011, https://launchpad.net/~michiel-beijen wrote: Show quoted text
> On Win32 with StrawberryPerl 5.12.3; some of the > attachment-filename-encoding tests are failing:
These tests PASS with MIME::tools 5.500 - it's just the latest 5.501 that is failing.
Subject: Re: [rt.cpan.org #66286] Test failing on Win32 / Perl 5.12.3
Date: Tue, 1 Mar 2011 09:34:10 -0500
To: bug-MIME-tools [...] rt.cpan.org
From: "David F. Skoll" <dfs [...] roaringpenguin.com>
On Tue, 1 Mar 2011 09:29:27 -0500 "https://launchpad.net/~michiel-beijen via RT" <bug-MIME-tools@rt.cpan.org> wrote: Show quoted text
> On Tue Mar 01 09:13:36 2011, https://launchpad.net/~michiel-beijen > wrote:
> > On Win32 with StrawberryPerl 5.12.3; some of the > > attachment-filename-encoding tests are failing:
I have no access to a Windows machine nor much interest in Win32. I suspect the problem is in t/attachment-filename-encoding.t here: $parser->output_under('/tmp'); There's probably no /tmp directory in a standard Windows install. Please try commenting out that line to see if it fixes it. If it does, I can come up with a workaround. Regards, David.
From: michiel.beijen [...] gmail.com
Hi Dave, thanks for your quick feedback! On Tue Mar 01 09:34:22 2011, dfs@roaringpenguin.com wrote: Show quoted text
> I suspect the problem is in t/attachment-filename-encoding.t here: > > $parser->output_under('/tmp');
Of course. Here's a patch I created for your test, using the File::Temp module. File::Temp is a core module (and has been at least since 5.6.1) and this makes the tests both run succesfully on my Fedora laptop and on my Win2008R2 server. Thanks, Mike --- t/attachment-filename-encoding.t.orig 2011-03-01 16:08:09.976277187 +0100 +++ t/attachment-filename-encoding.t 2011-03-01 16:09:08.652765481 +0100 @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use File::Temp; use utf8; binmode STDOUT, ":utf8"; @@ -44,9 +45,10 @@ # CPAN ticket #65162 # We need the default parser to tickle the bug + my $dir = File::Temp->newdir(); $parser = MIME::Parser->new(); $parser->output_to_core(0); - $parser->output_under('/tmp'); + $parser->output_under($dir); $entity = $parser->parse_data("From: test\@example.com\nSubject: test\nDate: Tue, 25 Jan 2011 14:35:04 +0100\nMessage-Id: <123\@example.com>\nContent-Type: text/plain; name*=utf-8''%CE%B2CURE%2Etxt\n\ntest\n"); $filename = $entity->head->recommended_filename; is(utf8::is_utf8($filename), 1, "Parsed filename should have UTF-8 flag on");
Subject: Re: [rt.cpan.org #66286] Test failing on Win32 / Perl 5.12.3
Date: Tue, 1 Mar 2011 10:36:22 -0500
To: bug-MIME-tools [...] rt.cpan.org
From: "David F. Skoll" <dfs [...] roaringpenguin.com>
Hi, Thanks for your patch. I used this slightly different version. If it fixes it for you, I will close this ticket. Regards, David. diff --git a/t/attachment-filename-encoding.t b/t/attachment-filename-encoding.t index f7e36a8..516c49d 100644 --- a/t/attachment-filename-encoding.t +++ b/t/attachment-filename-encoding.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; +use File::Temp qw(tempdir); use utf8; binmode STDOUT, ":utf8"; @@ -44,9 +45,10 @@ main: { # CPAN ticket #65162 # We need the default parser to tickle the bug + my $dir = tempdir(CLEANUP => 1); $parser = MIME::Parser->new(); $parser->output_to_core(0); - $parser->output_under('/tmp'); + $parser->output_under($dir); $entity = $parser->parse_data("From: test\@example.com\nSubject: test\nDate: Tue, 25 Jan 2011 14:35:04 +0100\nMessage-Id: <123\@example.com>\nContent-Type: text/plain; name*=utf-8''%CE%B2CURE%2Etxt\n\ntest\n"); $filename = $entity->head->recommended_filename; is(utf8::is_utf8($filename), 1, "Parsed filename should have UTF-8 flag on");
Subject: Re: [rt.cpan.org #66286] Test failing on Win32 / Perl 5.12.3
Date: Tue, 1 Mar 2011 21:32:03 +0100
To: bug-MIME-tools [...] rt.cpan.org
From: Michiel Beijen <michiel.beijen [...] gmail.com>
Great, works for me. -- Mike On Tue, Mar 1, 2011 at 4:36 PM, David F. Skoll via RT <bug-MIME-tools@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=66286 > > > Hi, > > Thanks for your patch.  I used this slightly different version.  If it > fixes it for you, I will close this ticket. > > Regards, > > David. > > > diff --git a/t/attachment-filename-encoding.t b/t/attachment-filename-encoding.t > index f7e36a8..516c49d 100644 > --- a/t/attachment-filename-encoding.t > +++ b/t/attachment-filename-encoding.t > @@ -3,6 +3,7 @@ >  use strict; >  use warnings; >  use Test::More; > +use File::Temp qw(tempdir); >  use utf8; > >  binmode STDOUT, ":utf8"; > @@ -44,9 +45,10 @@ main: { > >     # CPAN ticket #65162 >     # We need the default parser to tickle the bug > +    my $dir = tempdir(CLEANUP => 1); >     $parser = MIME::Parser->new(); >     $parser->output_to_core(0); > -    $parser->output_under('/tmp'); > +    $parser->output_under($dir); >     $entity = $parser->parse_data("From: test\@example.com\nSubject: test\nDate: Tue, 25 Jan 2011 14:35:04 +0100\nMessage-Id: <123\@example.com>\nContent-Type: text/plain; name*=utf-8''%CE%B2CURE%2Etxt\n\ntest\n"); >     $filename = $entity->head->recommended_filename; >     is(utf8::is_utf8($filename), 1, "Parsed filename should have UTF-8 flag on"); > >
Hi, The patch I posted has been committed to our git repo and will appear in the next release of MIME-tools. Regards, David.