Skip Menu |

This queue is for tickets about the File-Copy-NoClobber CPAN distribution.

Report information
The Basics
Id: 114658
Status: resolved
Worked: 10 min
Priority: 0/
Queue: File-Copy-NoClobber

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

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



Subject: Don't use string value of $! for checks
Some of my smokers report failures of the form: ... at t/11-copy-to-directory-with-rename.t line 35. # Tests were run but no plan was declared and done_testing() was not seen. # Looks like your test exited with 255 just after 3. t/11-copy-to-directory-with-rename.t .. Dubious, test returned 255 (wstat 65280, 0xff00) All 3 subtests passed ... This happens under two circumstances: * perl version is < 5.23.0 * a non-English locale is in effect Problem is probably this line: while (not $opened and $! =~ /File exists/i ) { Stringified errno messages are highly non-portable. The wording can differ between operating systems, and may be localized. It's better to use the symbolic value, e.g. $!{EEXISTS}. See perldoc Errno. Also what's problematic: the error message looks quite empty in this case. There's nothing before "at t/11-opy-to-directory-with-rename.t ...". Regards, Slaven
On 2016-05-24 15:58:06, SREZIC wrote: [...] Show quoted text
> This happens under two circumstances: > * perl version is < 5.23.0
Correction: this should read < 5.21.0.
Subject: Re: [rt.cpan.org #114658] Don't use string value of $! for checks
Date: Tue, 24 May 2016 23:19:27 +0200
To: bug-File-Copy-NoClobber [...] rt.cpan.org
From: Torbjørn Lindahl <torbjorn.lindahl [...] gmail.com>
Thanks, its simply wrong on all accounts to use stringified error messages like I did, turns out it was EEXIST , module updated with a test case for variuos common locales, thanks for the trouble. On Tue, May 24, 2016 at 9:59 PM, Slaven_Rezic via RT < bug-File-Copy-NoClobber@rt.cpan.org> wrote: Show quoted text
> Queue: File-Copy-NoClobber > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=114658 > > > On 2016-05-24 15:58:06, SREZIC wrote: > [...]
> > This happens under two circumstances: > > * perl version is < 5.23.0
> > Correction: this should read < 5.21.0. > >
-- mvh Torbjørn Lindahl
Fixed, checks %! instead of $!