Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Exception-Class-DBI CPAN distribution.

Report information
The Basics
Id: 20407
Status: resolved
Worked: 30 min
Priority: 0/
Queue: Exception-Class-DBI

People
Owner: dwheeler [...] cpan.org
Requestors: jens [...] elberet.de
Cc:
AdminCc:

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



Subject: Language dependency
Testing of Exception::Class::DBI v0.94 fails on Linux x86 with Perl 5.8.8 while in a locale that causes the system to emit non-English error messages. With LC_ALL and LANG set to "de_DE@euro", 'make test' emits this error: t/sth.........ok 1/35 # Failed test 'Check errstr' # in t/sth.t at line 37. # got: 'opendir(foo): Datei oder Verzeichnis nicht gefunden' # expected: 'opendir(foo): No such file or directory' # Failed test 'Check error' # in t/sth.t at line 39. # 'DBD::ExampleP::st execute failed: opendir(foo): Datei oder Verzeichnis nicht gefunden' # doesn't match '(?-xism:^DBD::ExampleP::st execute failed: opendir\(foo\): No such file or directory)' # Looks like you failed 2 tests of 35. Without any further changes but calling make as 'LANG= LC_ALL= make test', the test - and, when using CPAN.pm, subsequent install - passes without further problems. --- System Details: uname -a: Linux majestix 2.6.16.5 #1 Sun Apr 16 20:38:44 CEST 2006 i686 AMD-K7(tm) Processor GNU/Linux perl -V: Summary of my perl5 (revision 5 version 8 subversion 8) configuration: Platform: osname=linux, osvers=2.6.16.5, archname=i686-linux-thread-multi uname='linux majestix 2.6.16.5 #1 sun apr 16 20:38:44 cest 2006 i686 amd-k7(tm) processor gnulinux ' config_args='-des -Darchname=i686-linux-thread -Dcccdlflags=-fPIC -Dccdlflags=-rdynamic -Dcc=i686-pc-linux-gnu-gcc -Dprefix=/usr -Dvendorprefix=/usr -Dsiteprefix=/usr -Dlocincpth= -Doptimize=-O3 -pipe -mcpu=i686 -fomit-frame-pointer -Duselargefiles -Dd_semctl_semun -Dscriptdir=/usr/bin -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dinstallman1dir=/usr/share/man/man1 -Dinstallman3dir=/usr/share/man/man3 -Dman1ext=1 -Dman3ext=3pm -Dinc_version_list=5.8.7 5.8.7/i686-linux-thread-multi -Dcf_by=Gentoo -Ud_csh -Dusenm -Dusethreads -Di_ndbm -Di_gdbm -Di_db' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef useithreads=define usemultiplicity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='i686-pc-linux-gnu-gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O3 -pipe -mcpu=i686 -fomit-frame-pointer', cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -pipe' ccversion='', gccversion='3.3.6 (Gentoo 3.3.6, ssp-3.3.6-1.0, pie-8.7.8)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='i686-pc-linux-gnu-gcc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lpthread -lnsl -lndbm -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc libc=/lib/libc-2.3.6.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.3.6' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic' cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP THREADS_HAVE_PIDS USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API Built under linux Compiled at Jun 20 2006 03:19:22 %ENV: PERLDOC_PAGER="less -R" @INC: /etc/perl /usr/lib/perl5/vendor_perl/5.8.8/i686-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.7/i686-linux-thread-multi /usr/lib/perl5/vendor_perl /usr/lib/perl5/site_perl/5.8.8/i686-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.7/i686-linux-thread-multi /usr/lib/perl5/site_perl /usr/lib/perl5/5.8.8/i686-linux-thread-multi /usr/lib/perl5/5.8.8 . cat /etc/gentoo-release: Gentoo Base System version 1.6.14
Subject: Language dependency (adapted test cases)
From: mr.daniel.brook [...] gmail.com
On Tue Jul 11 04:57:05 2006, guest wrote: Show quoted text
> Testing of Exception::Class::DBI v0.94 fails on Linux x86 with Perl > 5.8.8 while in a locale that causes the system to emit non-English error > messages. With LC_ALL and LANG set to "de_DE@euro", 'make test' emits > this error: > > t/sth.........ok 1/35 > # Failed test 'Check errstr' > # in t/sth.t at line 37. > # got: 'opendir(foo): Datei oder Verzeichnis nicht gefunden' > # expected: 'opendir(foo): No such file or directory' > > # Failed test 'Check error' > # in t/sth.t at line 39. > # 'DBD::ExampleP::st execute failed: opendir(foo): > Datei oder Verzeichnis nicht gefunden' > # doesn't match '(?-xism:^DBD::ExampleP::st execute failed: > opendir\(foo\): No such file or directory)' > # Looks like you failed 2 tests of 35.
Instead of hard-coding the strings you could use the system's error messages e.g # Modified tests from sth.t { local $! = 2; # No such file or directory is( $err->errstr, "opendir(foo): $!", "Check errstr" ); like( $err->error, qr/^DBD::ExampleP::st execute failed: opendir\(foo\): $!/, "Check error" ); } I don't know if that'll work for sure, but I suspect it should. Cheers, Dan Brook (aka broquaint)
Subject: Re: [rt.cpan.org #20407] Language dependency
Date: Tue, 11 Jul 2006 11:22:20 -0700
To: bug-Exception-Class-DBI [...] rt.cpan.org
From: David Wheeler <dwheeler [...] cpan.org>
Thanks for the suggestion, Dan. Jens, does this patch do the trick for you? --- sth.t (revision 2968) +++ sth.t (working copy) @@ -29,15 +29,16 @@ # Make sure we got the proper exception. ok( my $err = $@, "Get exception" ); +my $bang = $!; isa_ok( $err, 'Exception::Class::DBI' ); isa_ok( $err, 'Exception::Class::DBI::H' ); isa_ok( $err, 'Exception::Class::DBI::STH' ); ok( $err->err == 2, "Check err" ); -is( $err->errstr, 'opendir(foo): No such file or directory', +is( $err->errstr, "opendir(foo): $bang", "Check errstr" ); like( $err->error, - qr/^DBD::ExampleP::st execute failed: opendir\(foo\): No such file or directory/, + qr/^DBD::ExampleP::st execute failed: opendir\(foo\): \E$bang/, "Check error" ); is( $err->state, 'S1000', "Check state" ); ok( ! defined $err->retval, "Check retval" );
Subject: Re: [rt.cpan.org #20407] Language dependency
Date: Wed, 19 Jul 2006 00:06:45 +0200
To: bug-Exception-Class-DBI [...] rt.cpan.org
From: Jens Maier <jens [...] elberet.de>
Yep, after applying the patch, sth.t passes nicely. -- Jens David Wheeler via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=20407 > > > Thanks for the suggestion, Dan. > > Jens, does this patch do the trick for you? > > --- sth.t (revision 2968) > +++ sth.t (working copy) > @@ -29,15 +29,16 @@ > > # Make sure we got the proper exception. > ok( my $err = $@, "Get exception" ); > +my $bang = $!; > isa_ok( $err, 'Exception::Class::DBI' ); > isa_ok( $err, 'Exception::Class::DBI::H' ); > isa_ok( $err, 'Exception::Class::DBI::STH' ); > > ok( $err->err == 2, "Check err" ); > -is( $err->errstr, 'opendir(foo): No such file or directory', > +is( $err->errstr, "opendir(foo): $bang", > "Check errstr" ); > like( $err->error, > - qr/^DBD::ExampleP::st execute failed: opendir\(foo\): No such > file or directory/, > + qr/^DBD::ExampleP::st execute failed: opendir\(foo\): \E$bang/, > "Check error" ); > is( $err->state, 'S1000', "Check state" ); > ok( ! defined $err->retval, "Check retval" ); > >
Download signature.asc
application/pgp-signature 187b

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #20407] Language dependency
Date: Tue, 18 Jul 2006 15:16:30 -0700
To: bug-Exception-Class-DBI [...] rt.cpan.org
From: David Wheeler <dwheeler [...] cpan.org>
On Jul 18, 2006, at 15:08, jens@elberet.de via RT wrote: Show quoted text
> Yep, after applying the patch, sth.t passes nicely.
Thanks. 0.95 is on its way to CPAN now.
Fixed in 0.95.