Subject: | RPC::XML colons in tempfile crash 50_client.t on cygwin |
Date: | Tue, 20 Nov 2007 00:08:10 +0100 |
To: | bug-RPC-XML [...] rt.cpan.org |
From: | Jörg Meltzer <joerg [...] joergmeltzer.de> |
I am using RPC::XML 0.59
I noticed that RPC::XML uses temporary files with colons, because it
derives the filename from __PACKAGE__.
This is causing hickups, t/50_client.t fails at test 18.
A Dumper on $res just befor the error reveals:
$VAR1 = 'RPC::XML::Client::send_request: Error opening
/home/johndoe/.cpan/build/RPC-XML-0.59-wVaeLg/t/RPC::XML::Client36121195513139:
No such file or directory';
not ok 18
I suggest a transformation of colons to dashes, which is fine with
Cygwin ( see patch below ).
$ uname -a
CYGWIN_NT-5.1 avenger 1.5.24(0.156/4/2) 2007-01-31 10:57 i686 Cygwin
$ perl -v
This is perl, v5.8.8 built for cygwin-thread-multi-64int
(with 8 registered patches, see perl -V for more detail)
Copyright 1987-2006, Larry Wall
Perl may be copied only under the terms of either the Artistic License
or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
$ diff -u blib/lib/RPC/XML/Client.pm lib/RPC/XML/Client.pm
--- blib/lib/RPC/XML/Client.pm 2007-11-19 23:44:57.359375000 +0100
+++ lib/RPC/XML/Client.pm 2007-11-19 23:45:19.593750000 +0100
@@ -236,7 +236,10 @@
require Symbol;
# Start by creating a temp-file
$tmpfile = $self->message_temp_dir || File::Spec->tmpdir;
- $tmpfile = File::Spec->catfile($tmpfile, __PACKAGE__ . $$ . time);
+ # colons not supported in cygwin
+ (my $_tmp = +__PACKAGE__) =~ s/::/-/g;
+ $_tmp .= $$ . time;
+ $tmpfile = File::Spec->catfile($tmpfile, $_tmp);
$req_fh = Symbol::gensym();
return "$me: Error opening $tmpfile: $!"
unless (open($req_fh, "+> $tmpfile"));
Patched 50_client.t gives:
# Current time GMT: Mon Nov 19 23:02:44 2007
# Using Test.pm version 1.25
ok 1
ok 2
ok 3
ok 4
ok 5
ok 6
ok 7
ok 8
ok 9
ok 10
ok 11
ok 12
ok 13
ok 14
ok 15
ok 16
ok 17
$VAR1 = bless( do{\(my $o = 1)}, 'RPC::XML::boolean' );
ok 18
ok 19
Cheers,
Jörg