Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

t/op/mkdir.t fails, setting LC_ALL=C does not work #10134

Closed
p5pRT opened this issue Feb 6, 2010 · 11 comments
Closed

t/op/mkdir.t fails, setting LC_ALL=C does not work #10134

p5pRT opened this issue Feb 6, 2010 · 11 comments

Comments

@p5pRT
Copy link

p5pRT commented Feb 6, 2010

Migrated from rt.perl.org#72588 (status was 'resolved')

Searchable as RT72588$

@p5pRT
Copy link
Author

p5pRT commented Feb 6, 2010

From eserte@biokovo.herceg.de

This is a bug report for perl from eserte@​biokovo.herceg.de,
generated with the help of perlbug 1.39 running under perl 5.11.4.


With non-English locale setting the op/mkdir.t test fails with
bleadperl​:

$ locale
LANG=
LC_CTYPE=de_DE.ISO8859-1
LC_COLLATE="de_DE.ISO8859-1"
LC_TIME="de_DE.ISO8859-1"
LC_NUMERIC="de_DE.ISO8859-1"
LC_MONETARY="de_DE.ISO8859-1"
LC_MESSAGES="de_DE.ISO8859-1"
LC_ALL=de_DE.ISO8859-1

$ ./perl -Ilib t/op/mkdir.t
1..22
...
not ok 7
# Failed at t/op/mkdir.t line 27
# got 'Datei oder Verzeichnis nicht gefunden'
# expected /(?i-xsm​:cannot find|such|exist|not found|not a directory|unknown)/

The test tries to force using an English message catalog by setting the
LC_ALL and LANGUAGE environment variables, but it seems that this
never had any effect​:

On Linux systems (tested with CentOS4 and Debian/lenny and standard perls)​:

$ locale
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
$ env LC_ALL=de_DE perl -e '$ENV{LC_ALL}="C";rmdir "/thisfiledoesnotexistXXXblafoobar" or die $!'
Datei oder Verzeichnis nicht gefunden at -e line 1.

On FreeBSD 8.0​:

$ locale
LANG=
LC_CTYPE="C"
LC_COLLATE="C"
LC_TIME="C"
LC_NUMERIC="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=C
$ env LC_ALL=de_DE.ISO8859-1 perl -e '$ENV{LC_ALL}="C";rmdir "/thisfiledoesnotexistXXXblafoobar" or die $!'
Datei oder Verzeichnis nicht gefunden at -e line 1.

(Solaris 10 and Mac OS X 10.3 have no localized messages catalogs
for strerror, it seems)

What works is setting the locale with POSIX​::setlocale(). See the
patch below.

But maybe it would be nice if the LC environment variable family
would automatically call the appropriate setlocale function? Or
would this be too much magic?

Regards,
  Slaven

From 41c2fb854944a52e211d72d0011d5a45d57ef023 Mon Sep 17 00​:00​:00 2001
From​: Slaven Rezic <slaven@​rezic.de>
Date​: Sat, 6 Feb 2010 22​:15​:24 +0100
Subject​: [PATCH] make sure $! is really not localized in the mkdir.t test


t/op/mkdir.t | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
mode change 100644 => 100755 t/op/mkdir.t

diff --git a/t/op/mkdir.t b/t/op/mkdir.t
old mode 100644
new mode 100755
index bd0d1b4..b4d3a4c
--- a/t/op/mkdir.t
+++ b/t/op/mkdir.t
@​@​ -14,6 +14,9 @​@​ rmtree('blurfl');
# tests 3 and 7 rather naughtily expect English error messages
$ENV{'LC_ALL'} = 'C';
$ENV{LANGUAGE} = 'C'; # GNU locale extension
+if (eval { require POSIX; defined &POSIX​::setlocale && &POSIX​::LC_MESSAGES }) {
+ POSIX​::setlocale(POSIX​::LC_MESSAGES(), 'C');
+}

ok(mkdir('blurfl',0777));
ok(!mkdir('blurfl',0777));
--
1.6.4.3



Flags​:
  category=core
  severity=low


Site configuration information for perl 5.11.4​:

Configured by eserte at Sat Feb 6 21​:16​:53 CET 2010.

Summary of my perl5 (revision 5 version 11 subversion 4) configuration​:
  Commit id​: 6369c73
  Platform​:
  osname=freebsd, osvers=8.0-release, archname=i386-freebsd
  uname='freebsd biokovo.herceg.de 8.0-release freebsd 8.0-release #0​: sat nov 21 15​:48​:17 utc 2009 root@​almeida.cse.buffalo.edu​:usrobjusrsrcsysgeneric i386 '
  config_args='-ds -e -Dusedevel'
  hint=recommended, useposix=true, d_sigaction=define
  useithreads=undef, usemultiplicity=undef
  useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
  use64bitint=undef, use64bitall=undef, uselongdouble=undef
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='cc', ccflags ='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include',
  optimize='-O',
  cppflags='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
  ccversion='', gccversion='4.2.1 20070719 [FreeBSD]', 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='cc', ldflags ='-Wl,-E -fstack-protector -L/usr/local/lib'
  libpth=/usr/lib /usr/local/lib
  libs=-lgdbm -lm -lcrypt -lutil -lc
  perllibs=-lm -lcrypt -lutil -lc
  libc=, so=so, useshrplib=false, libperl=libperl.a
  gnulibc_version=''
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
  cccdlflags='-DPIC -fPIC', lddlflags='-shared -L/usr/local/lib -fstack-protector'

Locally applied patches​:
 


@​INC for perl 5.11.4​:
  lib
  /usr/local/lib/perl5/site_perl/5.11.4/i386-freebsd
  /usr/local/lib/perl5/site_perl/5.11.4
  /usr/local/lib/perl5/5.11.4/i386-freebsd
  /usr/local/lib/perl5/5.11.4
  /usr/local/lib/perl5/site_perl
  .


Environment for perl 5.11.4​:
  HOME=/home/e/eserte
  LANG (unset)
  LANGUAGE (unset)
  LC_ALL=de_DE.ISO8859-1
  LC_CTYPE=de_DE.ISO8859-1
  LD_LIBRARY_PATH (unset)
  LOGDIR (unset)
  PATH=/usr/local/bin​:/usr/X11R6/bin​:/usr/X11/bin​:/usr/bin​:/bin​:/usr/local/sbin​:/usr/sbin​:/sbin​:/home/e/eserte/bin/freebsd8.0​:/home/e/eserte/bin/sh​:/home/e/eserte/bin​:/usr/games​:/home/e/eserte/devel
  PERLDOC=-MPod​::Perldoc​::ToTextOverstrike
  PERL_BADLANG (unset)
  PERL_HTML_DISPLAY_CLASS=HTML​::Display​::Mozilla
  SHELL=/bin/tcsh

@p5pRT
Copy link
Author

p5pRT commented Feb 7, 2010

From @rgarcia

On 6 February 2010 22​:23, eserte@​biokovo.herceg.de
<perlbug-followup@​perl.org> wrote​:

With non-English locale setting the op/mkdir.t test fails with
bleadperl​:

$ locale
LANG=
LC_CTYPE=de_DE.ISO8859-1
LC_COLLATE="de_DE.ISO8859-1"
LC_TIME="de_DE.ISO8859-1"
LC_NUMERIC="de_DE.ISO8859-1"
LC_MONETARY="de_DE.ISO8859-1"
LC_MESSAGES="de_DE.ISO8859-1"
LC_ALL=de_DE.ISO8859-1

$ ./perl -Ilib t/op/mkdir.t
1..22
...
not ok 7
# Failed at t/op/mkdir.t line 27
#      got 'Datei oder Verzeichnis nicht gefunden'
# expected /(?i-xsm​:cannot find|such|exist|not found|not a directory|unknown)/

The test tries to force using an English message catalog by setting the
LC_ALL and LANGUAGE environment variables, but it seems that this
never had any effect​:

On Linux systems (tested with CentOS4 and Debian/lenny and standard perls)​:

$ locale
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
$ env LC_ALL=de_DE perl -e '$ENV{LC_ALL}="C";rmdir "/thisfiledoesnotexistXXXblafoobar" or die $!'
Datei oder Verzeichnis nicht gefunden at -e line 1.

On FreeBSD 8.0​:

$ locale
LANG=
LC_CTYPE="C"
LC_COLLATE="C"
LC_TIME="C"
LC_NUMERIC="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=C
$ env LC_ALL=de_DE.ISO8859-1 perl -e '$ENV{LC_ALL}="C";rmdir "/thisfiledoesnotexistXXXblafoobar" or die $!'
Datei oder Verzeichnis nicht gefunden at -e line 1.

(Solaris 10 and Mac OS X 10.3 have no localized messages catalogs
for strerror, it seems)

What works is setting the locale with POSIX​::setlocale(). See the
patch below.

For extra portability I think we could use %! instead of $!.

But maybe it would be nice if the LC environment variable family
would automatically call the appropriate setlocale function? Or
would this be too much magic?

I think it would be too much, yes.

From 41c2fb854944a52e211d72d0011d5a45d57ef023 Mon Sep 17 00​:00​:00 2001
From​: Slaven Rezic <slaven@​rezic.de>
Date​: Sat, 6 Feb 2010 22​:15​:24 +0100
Subject​: [PATCH] make sure $! is really not localized in the mkdir.t test

---
 t/op/mkdir.t |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 t/op/mkdir.t

diff --git a/t/op/mkdir.t b/t/op/mkdir.t
old mode 100644
new mode 100755
index bd0d1b4..b4d3a4c
--- a/t/op/mkdir.t
+++ b/t/op/mkdir.t
@​@​ -14,6 +14,9 @​@​ rmtree('blurfl');
 # tests 3 and 7 rather naughtily expect English error messages
 $ENV{'LC_ALL'} = 'C';
 $ENV{LANGUAGE} = 'C'; # GNU locale extension
+if (eval { require POSIX; defined &POSIX​::setlocale && &POSIX​::LC_MESSAGES }) {
+    POSIX​::setlocale(POSIX​::LC_MESSAGES(), 'C');
+}

 ok(mkdir('blurfl',0777));
 ok(!mkdir('blurfl',0777));
--
1.6.4.3

-----------------------------------------------------------------
---
Flags​:
   category=core
   severity=low
---
Site configuration information for perl 5.11.4​:

Configured by eserte at Sat Feb  6 21​:16​:53 CET 2010.

Summary of my perl5 (revision 5 version 11 subversion 4) configuration​:
 Commit id​: 6369c73
 Platform​:
   osname=freebsd, osvers=8.0-release, archname=i386-freebsd
   uname='freebsd biokovo.herceg.de 8.0-release freebsd 8.0-release #0​: sat nov 21 15​:48​:17 utc 2009 root@​almeida.cse.buffalo.edu​:usrobjusrsrcsysgeneric i386 '
   config_args='-ds -e -Dusedevel'
   hint=recommended, useposix=true, d_sigaction=define
   useithreads=undef, usemultiplicity=undef
   useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
   use64bitint=undef, use64bitall=undef, uselongdouble=undef
   usemymalloc=n, bincompat5005=undef
 Compiler​:
   cc='cc', ccflags ='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include',
   optimize='-O',
   cppflags='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
   ccversion='', gccversion='4.2.1 20070719  [FreeBSD]', 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='cc', ldflags ='-Wl,-E  -fstack-protector -L/usr/local/lib'
   libpth=/usr/lib /usr/local/lib
   libs=-lgdbm -lm -lcrypt -lutil -lc
   perllibs=-lm -lcrypt -lutil -lc
   libc=, so=so, useshrplib=false, libperl=libperl.a
   gnulibc_version=''
 Dynamic Linking​:
   dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
   cccdlflags='-DPIC -fPIC', lddlflags='-shared  -L/usr/local/lib -fstack-protector'

Locally applied patches​:

---
@​INC for perl 5.11.4​:
   lib
   /usr/local/lib/perl5/site_perl/5.11.4/i386-freebsd
   /usr/local/lib/perl5/site_perl/5.11.4
   /usr/local/lib/perl5/5.11.4/i386-freebsd
   /usr/local/lib/perl5/5.11.4
   /usr/local/lib/perl5/site_perl
   .

---
Environment for perl 5.11.4​:
   HOME=/home/e/eserte
   LANG (unset)
   LANGUAGE (unset)
   LC_ALL=de_DE.ISO8859-1
   LC_CTYPE=de_DE.ISO8859-1
   LD_LIBRARY_PATH (unset)
   LOGDIR (unset)
   PATH=/usr/local/bin​:/usr/X11R6/bin​:/usr/X11/bin​:/usr/bin​:/bin​:/usr/local/sbin​:/usr/sbin​:/sbin​:/home/e/eserte/bin/freebsd8.0​:/home/e/eserte/bin/sh​:/home/e/eserte/bin​:/usr/games​:/home/e/eserte/devel
   PERLDOC=-MPod​::Perldoc​::ToTextOverstrike
   PERL_BADLANG (unset)
   PERL_HTML_DISPLAY_CLASS=HTML​::Display​::Mozilla
   SHELL=/bin/tcsh

--
"You don't mean odds and ends, you mean des curieux et des bouts",
corrected the manager.
-- Terry Pratchett, Hogfather

@p5pRT
Copy link
Author

p5pRT commented Feb 7, 2010

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Feb 7, 2010

From @eserte

Rafael Garcia-Suarez <rgs@​consttype.org> writes​:

On 6 February 2010 22​:23, eserte@​biokovo.herceg.de
<perlbug-followup@​perl.org> wrote​:

With non-English locale setting the op/mkdir.t test fails with
bleadperl​:

$ locale
LANG=
LC_CTYPE=de_DE.ISO8859-1
LC_COLLATE="de_DE.ISO8859-1"
LC_TIME="de_DE.ISO8859-1"
LC_NUMERIC="de_DE.ISO8859-1"
LC_MONETARY="de_DE.ISO8859-1"
LC_MESSAGES="de_DE.ISO8859-1"
LC_ALL=de_DE.ISO8859-1

$ ./perl -Ilib t/op/mkdir.t
1..22
...
not ok 7
# Failed at t/op/mkdir.t line 27
#      got 'Datei oder Verzeichnis nicht gefunden'
# expected /(?i-xsm​:cannot find|such|exist|not found|not a directory|unknown)/

The test tries to force using an English message catalog by setting the
LC_ALL and LANGUAGE environment variables, but it seems that this
never had any effect​:

On Linux systems (tested with CentOS4 and Debian/lenny and standard perls)​:

$ locale
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
$ env LC_ALL=de_DE perl -e '$ENV{LC_ALL}="C";rmdir "/thisfiledoesnotexistXXXblafoobar" or die $!'
Datei oder Verzeichnis nicht gefunden at -e line 1.

On FreeBSD 8.0​:

$ locale
LANG=
LC_CTYPE="C"
LC_COLLATE="C"
LC_TIME="C"
LC_NUMERIC="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=C
$ env LC_ALL=de_DE.ISO8859-1 perl -e '$ENV{LC_ALL}="C";rmdir "/thisfiledoesnotexistXXXblafoobar" or die $!'
Datei oder Verzeichnis nicht gefunden at -e line 1.

(Solaris 10 and Mac OS X 10.3 have no localized messages catalogs
for strerror, it seems)

What works is setting the locale with POSIX​::setlocale(). See the
patch below.

For extra portability I think we could use %! instead of $!.

I see. Maybe the following patch would be better? Can we rely that
Errno.pm is everywhere installed?

@p5pRT
Copy link
Author

p5pRT commented Feb 7, 2010

From @eserte

0001-do-not-rely-on-stringified-in-mkdir.t-test.patch
From fefed73a5eb3e5ab442b8bf0ca1cdac0fa00e6c0 Mon Sep 17 00:00:00 2001
From: Slaven Rezic <slaven@rezic.de>
Date: Sun, 7 Feb 2010 14:33:08 +0100
Subject: [PATCH] do not rely on stringified $! in mkdir.t test

---
 t/op/mkdir.t |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/op/mkdir.t b/t/op/mkdir.t
index bd0d1b4..0ad5dac 100644
--- a/t/op/mkdir.t
+++ b/t/op/mkdir.t
@@ -17,11 +17,11 @@ $ENV{LANGUAGE} = 'C'; # GNU locale extension
 
 ok(mkdir('blurfl',0777));
 ok(!mkdir('blurfl',0777));
-like($!, qr/cannot move|exist|denied|unknown/i);
+ok($!{EEXIST} || $! =~ /cannot move|exist|denied|unknown/i);
 ok(-d 'blurfl');
 ok(rmdir('blurfl'));
 ok(!rmdir('blurfl'));
-like($!, qr/cannot find|such|exist|not found|not a directory|unknown/i);
+ok($!{ENOENT} || $! =~ /cannot find|such|exist|not found|not a directory|unknown/i);
 ok(mkdir('blurfl'));
 ok(rmdir('blurfl'));
 
-- 
1.6.4.3

@p5pRT
Copy link
Author

p5pRT commented Feb 7, 2010

From @eserte

--
Slaven Rezic - slaven <at> rezic <dot> de

  tktimex - time recording tool
  http​://sourceforge.net/projects/ptktools/

@p5pRT
Copy link
Author

p5pRT commented Mar 29, 2010

From @eserte

The following issue is still not resolved in 5.12.0-RC0​:

Slaven Rezic <slaven@​rezic.de> writes​:

Rafael Garcia-Suarez <rgs@​consttype.org> writes​:

On 6 February 2010 22​:23, eserte@​biokovo.herceg.de
<perlbug-followup@​perl.org> wrote​:

With non-English locale setting the op/mkdir.t test fails with
bleadperl​:

$ locale
LANG=
LC_CTYPE=de_DE.ISO8859-1
LC_COLLATE="de_DE.ISO8859-1"
LC_TIME="de_DE.ISO8859-1"
LC_NUMERIC="de_DE.ISO8859-1"
LC_MONETARY="de_DE.ISO8859-1"
LC_MESSAGES="de_DE.ISO8859-1"
LC_ALL=de_DE.ISO8859-1

$ ./perl -Ilib t/op/mkdir.t
1..22
...
not ok 7
# Failed at t/op/mkdir.t line 27
#      got 'Datei oder Verzeichnis nicht gefunden'
# expected /(?i-xsm​:cannot find|such|exist|not found|not a directory|unknown)/

The test tries to force using an English message catalog by setting the
LC_ALL and LANGUAGE environment variables, but it seems that this
never had any effect​:

On Linux systems (tested with CentOS4 and Debian/lenny and standard perls)​:

$ locale
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
$ env LC_ALL=de_DE perl -e '$ENV{LC_ALL}="C";rmdir "/thisfiledoesnotexistXXXblafoobar" or die $!'
Datei oder Verzeichnis nicht gefunden at -e line 1.

On FreeBSD 8.0​:

$ locale
LANG=
LC_CTYPE="C"
LC_COLLATE="C"
LC_TIME="C"
LC_NUMERIC="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=C
$ env LC_ALL=de_DE.ISO8859-1 perl -e '$ENV{LC_ALL}="C";rmdir "/thisfiledoesnotexistXXXblafoobar" or die $!'
Datei oder Verzeichnis nicht gefunden at -e line 1.

(Solaris 10 and Mac OS X 10.3 have no localized messages catalogs
for strerror, it seems)

What works is setting the locale with POSIX​::setlocale(). See the
patch below.

For extra portability I think we could use %! instead of $!.

I see. Maybe the following patch would be better? Can we rely that
Errno.pm is everywhere installed?

From fefed73a5eb3e5ab442b8bf0ca1cdac0fa00e6c0 Mon Sep 17 00​:00​:00 2001
From​: Slaven Rezic <slaven@​rezic.de>
Date​: Sun, 7 Feb 2010 14​:33​:08 +0100
Subject​: [PATCH] do not rely on stringified $! in mkdir.t test

---
t/op/mkdir.t | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/op/mkdir.t b/t/op/mkdir.t
index bd0d1b4..0ad5dac 100644
--- a/t/op/mkdir.t
+++ b/t/op/mkdir.t
@​@​ -17,11 +17,11 @​@​ $ENV{LANGUAGE} = 'C'; # GNU locale extension

ok(mkdir('blurfl',0777));
ok(!mkdir('blurfl',0777));
-like($!, qr/cannot move|exist|denied|unknown/i);
+ok($!{EEXIST} || $! =~ /cannot move|exist|denied|unknown/i);
ok(-d 'blurfl');
ok(rmdir('blurfl'));
ok(!rmdir('blurfl'));
-like($!, qr/cannot find|such|exist|not found|not a directory|unknown/i);
+ok($!{ENOENT} || $! =~ /cannot find|such|exist|not found|not a directory|unknown/i);
ok(mkdir('blurfl'));
ok(rmdir('blurfl'));

--
1.6.4.3

--
Slaven Rezic - slaven <at> rezic <dot> de

  tktimex - time recording tool
  http​://sourceforge.net/projects/ptktools/

@p5pRT
Copy link
Author

p5pRT commented Mar 31, 2010

From @obra

On Mon, Mar 29, 2010 at 10​:45​:42AM +0200, Slaven Rezic wrote​:

The following issue is still not resolved in 5.12.0-RC0​:

Let's look at this for 5.12.1.

@p5pRT
Copy link
Author

p5pRT commented May 6, 2010

From @eserte

Jesse Vincent <jesse@​fsck.com> writes​:

On Mon, Mar 29, 2010 at 10​:45​:42AM +0200, Slaven Rezic wrote​:

The following issue is still not resolved in 5.12.0-RC0​:

Let's look at this for 5.12.1.

So time to do this now? Here's my proposed patch again​:

From fefed73a5eb3e5ab442b8bf0ca1cdac0fa00e6c0 Mon Sep 17 00​:00​:00 2001
From​: Slaven Rezic <slaven@​rezic.de>
Date​: Sun, 7 Feb 2010 14​:33​:08 +0100
Subject​: [PATCH] do not rely on stringified $! in mkdir.t test


t/op/mkdir.t | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

Inline Patch
diff --git a/t/op/mkdir.t b/t/op/mkdir.t
index bd0d1b4..0ad5dac 100644
--- a/t/op/mkdir.t
+++ b/t/op/mkdir.t
@@ -17,11 +17,11 @@ $ENV{LANGUAGE} = 'C'; # GNU locale extension
 
 ok(mkdir('blurfl',0777));
 ok(!mkdir('blurfl',0777));
-like($!, qr/cannot move|exist|denied|unknown/i);
+ok($!{EEXIST} || $! =~ /cannot move|exist|denied|unknown/i);
 ok(-d 'blurfl');
 ok(rmdir('blurfl'));
 ok(!rmdir('blurfl'));
-like($!, qr/cannot find|such|exist|not found|not a directory|unknown/i);
+ok($!{ENOENT} || $! =~ /cannot find|such|exist|not found|not a directory|unknown/i);
 ok(mkdir('blurfl'));
 ok(rmdir('blurfl'));
 
-- 
1.6.4.3

--
Slaven Rezic - slaven <at> rezic <dot> de

  Berlin Perl Mongers - http​://berlin.pm.org

@p5pRT
Copy link
Author

p5pRT commented Aug 14, 2010

From @smpeters

On Thu May 06 13​:54​:22 2010, slaven@​rezic.de wrote​:

Jesse Vincent <jesse@​fsck.com> writes​:

On Mon, Mar 29, 2010 at 10​:45​:42AM +0200, Slaven Rezic wrote​:

The following issue is still not resolved in 5.12.0-RC0​:

Let's look at this for 5.12.1.

So time to do this now? Here's my proposed patch again​:

From fefed73a5eb3e5ab442b8bf0ca1cdac0fa00e6c0 Mon Sep 17 00​:00​:00 2001
From​: Slaven Rezic <slaven@​rezic.de>
Date​: Sun, 7 Feb 2010 14​:33​:08 +0100
Subject​: [PATCH] do not rely on stringified $! in mkdir.t test

---
t/op/mkdir.t | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/op/mkdir.t b/t/op/mkdir.t
index bd0d1b4..0ad5dac 100644
--- a/t/op/mkdir.t
+++ b/t/op/mkdir.t
@​@​ -17,11 +17,11 @​@​ $ENV{LANGUAGE} = 'C'; # GNU locale extension

ok(mkdir('blurfl',0777));
ok(!mkdir('blurfl',0777));
-like($!, qr/cannot move|exist|denied|unknown/i);
+ok($!{EEXIST} || $! =~ /cannot move|exist|denied|unknown/i);
ok(-d 'blurfl');
ok(rmdir('blurfl'));
ok(!rmdir('blurfl'));
-like($!, qr/cannot find|such|exist|not found|not a
directory|unknown/i);
+ok($!{ENOENT} || $! =~ /cannot find|such|exist|not found|not a
directory|unknown/i);
ok(mkdir('blurfl'));
ok(rmdir('blurfl'));

Thanks! I've committed this patch as change a9e1ff3.

Steve

@p5pRT
Copy link
Author

p5pRT commented Aug 14, 2010

@smpeters - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant