Skip Menu |
 

This queue is for tickets about the IPC-Shareable CPAN distribution.

Report information
The Basics
Id: 91197
Status: new
Priority: 0/
Queue: IPC-Shareable

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

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

Attachments
0001-check-does-not-depend-on-locale-anymore.patch



Subject: t/35clean.t may depend on locale
Download (untitled) / with headers
text/plain 327b
Some test cases in t/35clean.t may fail if the current locale does not use English error messages (problem seen on a Linux Mint 13 system with German locale). The attached patch fixes the problem by checking Errno constants first, and if this does not work then fallback to the old stringy error messages. Regards, Slaven
Subject: 0001-check-does-not-depend-on-locale-anymore.patch
From 4374bad1ba8861ffd04c7a8c21b79768daf054e5 Mon Sep 17 00:00:00 2001 From: Slaven Rezic <srezic@cpan.org> Date: Thu, 5 Dec 2013 15:57:08 +0100 Subject: [PATCH] $! check does not depend on locale anymore --- t/35clean.t | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/t/35clean.t b/t/35clean.t index a402fed..8e7f749 100644 --- a/t/35clean.t +++ b/t/35clean.t @@ -7,6 +7,7 @@ BEGIN { use strict; use Carp; +use Errno; use IPC::Shareable; use IPC::Shareable::SharedMem; my $t = 1; @@ -16,8 +17,11 @@ sub gonzo { # --- shmread should barf if the segment has really been cleaned my $id = shift; my $data = ''; - eval { shmread($id, $data, 0, 6) or die "$!" }; - return scalar($@ =~ /Invalid/ or $@ =~ /removed/); + shmread($id, $data, 0, 6) and return 0; + return $!{EINVAL} || $!{EIDRM}; # expected errno errors + # fallback to string error messages, works only with English locale + # on some systems + return scalar($! =~ /Invalid/ or $! =~ /removed/); } # --- remove() -- 1.7.9.5
Download (untitled) / with headers
text/plain 349b
On 2013-12-05 10:03:42, SREZIC wrote: Show quoted text
> Some test cases in t/35clean.t may fail if the current locale does not > use English error messages (problem seen on a Linux Mint 13 system > with German locale).
Here's a sample fail report on cpan testers: http://www.cpantesters.org/cpan/report/e800c3fc-db32-11e2-91c6-68af0fcc62a0 Regards, Slaven
Download (untitled) / with headers
text/plain 495b
On 2013-12-05 10:03:42, SREZIC wrote: Show quoted text
> Some test cases in t/35clean.t may fail if the current locale does not > use English error messages (problem seen on a Linux Mint 13 system > with German locale). The attached patch fixes the problem by checking > Errno constants first, and if this does not work then fallback to the > old stringy error messages.
This error does not happen anymore for newer perls (since 5.22 or so), as stringified errno is localized only if "use locale" is in effect.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.