Skip Menu |

This queue is for tickets about the XML-RSS CPAN distribution.

Report information
The Basics
Id: 11124
Status: resolved
Priority: 0/
Queue: XML-RSS

People
Owner: Nobody in particular
Requestors: LGODDARD [...] cpan.org
SMPETERS [...] cpan.org
v.haisman [...] sh.cvut.cz
Cc:
AdminCc:

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



Subject: XML::RSS 1.05 - 2.0-generate test 14 failure
The following error was received from my install of XML::RSS 1.05 on Windows NT 4.0. not ok 14 - t/2.0-generated.xml has '1583' characters. # Failed test (t/2.0-generate.t at line 106) # got: '1583' # expected: '1535' # Looks like you failed 1 tests of 25. The error is caused by a bug in the test script. On UNIX (and Cygwin where it also installs just fine), the end of line character is a line feed "\n" character. On Windows, however, its a carriage return and a line feed character "\r\n". The test where the error occurs is checking to see if size of the generated XML file is the size expected. The size its expecting is 1535 bytes. On Windows, it gets 1583. The file is 49 lines long. The difference between the two is 49 bytes. It appears that the test does not take into account the different line endings when calculating the expected size.
The way the test works is the length of the generated RSS is compared to the size of the file when it is serialized to disk. You're saying that this doesn't work under Windows? I would have expected any differences in the newlines characters to have shown up during the initial call to length.
The extra characters are only added when written to a file. They are also "magically" removed when read in. For example, I read the generated XML file back in and performed an "ord" on every character. There are 1535 characters read in as expected. The file in bytes is still 1583.
[KELLAN - Fri Aug 13 11:26:46 2004]: Show quoted text
> The way the test works is the length of the generated RSS is compared > to > the size of the file when it is serialized to disk. You're saying > that > this doesn't work under Windows? > > I would have expected any differences in the newlines characters to > have > shown up during the initial call to length.
read `perldoc -f binmode' sometimes to learn whats going on
Subject: XML::RSS ignores output encoding
Sub save in RSS.pm opens an output file without binmode or explicitly specified encoding which makes its output wrong. Attached patch solves the problem for me.
*** RSS.pm~ Sat Jan 1 22:23:28 2005 --- RSS.pm Sat Jan 1 23:28:48 2005 *************** sub parsefile { *** 1611,1617 **** sub save { my ($self,$file) = @_; ! open(OUT,">$file") || croak "Cannot open file $file for write: $!"; print OUT $self->as_string; close OUT; } --- 1611,1618 ---- sub save { my ($self,$file) = @_; ! open(OUT, ">:encoding($self->{encoding})", "$file") ! || croak "Cannot open file $file for write: $!"; print OUT $self->as_string; close OUT; }
Subject: Fails tests
Microsoft (R) Program Maintenance Utility Version 1.50 Copyright (c) Microsoft Corp 1988-94. All rights reserved. cp lib/XML/RSS.pm blib\lib\XML\RSS.pm C:/photowebserver/perl/bin/nmake.EXE -- OK Running make test Microsoft (R) Program Maintenance Utility Version 1.50 Copyright (c) Microsoft Corp 1988-94. All rights reserved. C:\perl58\bin\perl.exe "-MTest::Manifest" "-e" "run_t_manifest (0, 'blib\ lib', 'blib\arch')" Level is Test::Manifest::test_harness found [t\version.t t\encoding.t t\0.9- parse.t t\0.9 1-parse.t t\1.0-parse.t t\1.0-parse-exotic.t t\2.0-parse.t t\2.0- generate.t t\en code-output.t t\auto_add_modules.t] t\version.............ok t\encoding............ok t\0.9-parse...........ok t\0.91-parse..........ok t\1.0-parse...........ok t\1.0-parse-exotic....ok t\2.0-parse...........ok t\2.0-generate........NOK 14 # Failed test 't/2.0-generated.xml has '1577' characters.' # in t\2.0-generate.t at line 103. # got: '1577' # expected: '1529' # Looks like you failed 1 test of 26. t\2.0-generate........dubious Test returned status 1 (wstat 256, 0x100) DIED. FAILED test 14 Failed 1/26 tests, 96.15% okay t\encode-output.......ok t\auto_add_modules....ok Failed Test Stat Wstat Total Fail Failed List of Failed ----------------------------------------------------------------------- -------- t\2.0-generate.t 1 256 26 1 3.85% 14 Failed 1/10 test scripts, 90.00% okay. 1/87 subtests failed, 98.85% okay. # Looks like your test died before it could output anything. NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return code '0xff' Stop. C:/photowebserver/perl/bin/nmake.EXE test -- NOT OK Running make install make test had returned bad status, won't install without force Failed during this command: ABH/XML-RSS-1.10.tar.gz : make_test NO Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\Me>perl -V Summary of my perl5 (revision 5 version 8 subversion 8) configuration: Platform: osname=MSWin32, osvers=5.0, archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef usethreads=define use5005threads=undef useithreads=define usemultiplicity=de fine useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cl', ccflags ='-nologo -GF -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 - D_CONSOLE - DNO_STRICT -DHAVE_DES_FCRYPT -DNO_HASH_SEED -DUSE_SITECUSTOMIZE - DPERL_IMPLICIT_ CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX', optimize='-MD -Zi -DNDEBUG -O1', cppflags='-DWIN32' ccversion='12.00.8804', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64', lseeksi ze=8 alignbytes=8, prototype=define Linker and Libraries: ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf - libpath:"C: \perl58\lib\CORE" -machine:x86' libpth=\lib libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32 .lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib ws2_ 32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msvcrt.lib perllibs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comd lg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msvcrt.lib libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl58.lib gnulibc_version='' Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug - opt:ref,icf - libpath:"C:\perl58\lib\CORE" -machine:x86' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS PERL_MALLOC_WRAP PL_OP_SLAB_ALLOC USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_SITECUSTOMIZE Locally applied patches: ActivePerl Build 817 [257965] Iin_load_module moved for compatibility with build 806 PerlEx support in CGI::Carp Less verbose ExtUtils::Install and Pod::Find Patch for CAN-2005-0448 from Debian with modifications Partly reverted 24733 to preserve binary compatibilty 27528 win32_pclose() error exit doesn't unlock mutex 27527 win32_async_check() can loop indefinitely 27515 ignore directories when searching @INC 27359 Fix -d:Foo=bar syntax 27210 Fix quote typo in c2ph 27203 Allow compiling swigged C++ code 27200 Make stat() on Windows handle trailing slashes correctly 27194 Get perl_fini() running on HP-UX again 27133 Initialise lastparen in the regexp structure 27034 Avoid "Prototype mismatch" warnings with autouse 26970 Make Passive mode the default for Net::FTP 26921 Avoid getprotobyname/number calls in IO::Socket::INET 26897,26903 Make common IPPROTO_* constants always available 26670 Make '-s' on the shebang line parse -foo=bar switches 26379 Fix alarm() for Windows 2003 26087 Storable 0.1 compatibility 25861 IO::File performace issue 25084 long groups entry could cause memory exhaustion 24699 ICMP_UNREACHABLE handling in Net::Ping Built under MSWin32 Compiled at Mar 20 2006 17:54:25 @INC: C:/perl58/lib C:/perl58/site/lib . C:\Documents and Settings\Me>
Hmn, I don't have a Win32 system to test on. Can you give some more hints? My guess is that it's a bug in the test rather than in the module. (Until then I'll mark it as resolved).
Subject: Re: [rt.cpan.org #21046] Fails tests
Date: Sun, 15 Oct 2006 20:53:55 +0100
To: bug-XML-RSS [...] rt.cpan.org
From: Lee Goddard <lee [...] leegoddard.net>
via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=21046 > > > Hmn, I don't have a Win32 system to test on. Can you give some more hints? My guess is that > it's a bug in the test rather than in the module. > > (Until then I'll mark it as resolved). > >
Sorry, I've opened your ticket by replying by e-mail (the web server is really poor). I've had another go and all the tests pass without problems. Unfortunately, I don't know how many tens of modules were installed on the system in the meantime. The error seen in the past was # Failed test 't/2.0-generated.xml has '1577' characters.' # in t\2.0-generate.t at line 103. # got: '1577' # expected: '1529' # Looks like you failed 1 test of 26. I guess, since your test name includes test result, that it is the 'expected' result that is incorrect (or that you've the comparison function arguments inverted). Anyway, AOK - thank you! Lee -- Lee Goddard Server-side Systems Ltd London N1 :: 0208 369 6832

Message body is not shown because sender requested not to inline it.

From: SMPETERS [...] cpan.org
On Fri Aug 13 08:48:24 2004, SMPETERS wrote: Show quoted text
> The following error was received from my install of XML::RSS 1.05 on > Windows NT 4.0. > > not ok 14 - t/2.0-generated.xml has '1583' characters. > # Failed test (t/2.0-generate.t at line 106) > # got: '1583' > # expected: '1535' > # Looks like you failed 1 tests of 25. > > The error is caused by a bug in the test script. On UNIX (and Cygwin > where it also installs just fine), the end of line character is a line > feed "\n" character. On Windows, however, its a carriage return and a > line feed character "\r\n". The test where the error occurs is checking > to see if size of the generated XML file is the size expected. The size > its expecting is 1535 bytes. On Windows, it gets 1583. The file is 49 > lines long. The difference between the two is 49 bytes. It appears > that the test does not take into account the different line endings when > calculating the expected size.
Actually, the following patch fixes this problem. $ diff -u lib/XML/RSS.pm.old lib/XML/RSS.pm --- lib/XML/RSS.pm.old 2006-10-18 08:59:37.656250000 -0500 +++ lib/XML/RSS.pm 2006-10-18 08:58:31.156250000 -0500 @@ -1611,6 +1611,7 @@ sub save { my ($self,$file) = @_; open(OUT,">$file") || croak "Cannot open file $file for write: $!"; + binmode OUT if $^O =~ /win32/i; print OUT $self->as_string; close OUT; }
On Thu Aug 17 08:57:23 2006, LGODDARD wrote: Show quoted text
> Microsoft (R) Program Maintenance Utility Version 1.50 > Copyright (c) Microsoft Corp 1988-94. All rights reserved. > > cp lib/XML/RSS.pm blib\lib\XML\RSS.pm > C:/photowebserver/perl/bin/nmake.EXE -- OK > Running make test > > Microsoft (R) Program Maintenance Utility Version 1.50 > Copyright (c) Microsoft Corp 1988-94. All rights reserved. > > C:\perl58\bin\perl.exe "-MTest::Manifest" "-e" "run_t_manifest > (0, 'blib\ > lib', 'blib\arch')" > Level is > Test::Manifest::test_harness found [t\version.t t\encoding.t t\0.9- > parse.t t\0.9 > 1-parse.t t\1.0-parse.t t\1.0-parse-exotic.t t\2.0-parse.t t\2.0- > generate.t t\en > code-output.t t\auto_add_modules.t] > t\version.............ok > t\encoding............ok > t\0.9-parse...........ok > t\0.91-parse..........ok > t\1.0-parse...........ok > t\1.0-parse-exotic....ok > t\2.0-parse...........ok > t\2.0-generate........NOK 14 > # Failed test 't/2.0-generated.xml has '1577' characters.' > # in t\2.0-generate.t at line 103. > # got: '1577' > # expected: '1529' > # Looks like you failed 1 test of 26. > t\2.0-generate........dubious > Test returned status 1 (wstat 256, 0x100) > DIED. FAILED test 14 > Failed 1/26 tests, 96.15% okay > t\encode-output.......ok > t\auto_add_modules....ok > Failed Test Stat Wstat Total Fail Failed List of Failed > ----------------------------------------------------------------------- > -------- > t\2.0-generate.t 1 256 26 1 3.85% 14 > Failed 1/10 test scripts, 90.00% okay. 1/87 subtests failed, 98.85% > okay. > # Looks like your test died before it could output anything. > NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return > code '0xff' > Stop. > C:/photowebserver/perl/bin/nmake.EXE test -- NOT OK > Running make install > make test had returned bad status, won't install without force > Failed during this command: > ABH/XML-RSS-1.10.tar.gz : make_test NO > > Microsoft Windows XP [Version 5.1.2600] > (C) Copyright 1985-2001 Microsoft Corp. > > C:\Documents and Settings\Me>perl -V > Summary of my perl5 (revision 5 version 8 subversion 8) configuration: > Platform: > osname=MSWin32, osvers=5.0, archname=MSWin32-x86-multi-thread > uname='' > config_args='undef' > hint=recommended, useposix=true, d_sigaction=undef > usethreads=define use5005threads=undef useithreads=define > usemultiplicity=de > fine > useperlio=define d_sfio=undef uselargefiles=define usesocks=undef > use64bitint=undef use64bitall=undef uselongdouble=undef > usemymalloc=n, bincompat5005=undef > Compiler: > cc='cl', ccflags ='-nologo -GF -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 - > D_CONSOLE - > DNO_STRICT -DHAVE_DES_FCRYPT -DNO_HASH_SEED -DUSE_SITECUSTOMIZE - > DPERL_IMPLICIT_ > CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX', > optimize='-MD -Zi -DNDEBUG -O1', > cppflags='-DWIN32' > ccversion='12.00.8804', gccversion='', gccosandvers='' > intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 > d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10 > ivtype='long', ivsize=4, nvtype='double', nvsize=8, > Off_t='__int64', lseeksi > ze=8 > alignbytes=8, prototype=define > Linker and Libraries: > ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf - > libpath:"C: > \perl58\lib\CORE" -machine:x86' > libpth=\lib > libs= oldnames.lib kernel32.lib user32.lib gdi32.lib > winspool.lib comdlg32 > .lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib > uuid.lib ws2_ > 32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib > msvcrt.lib > perllibs= oldnames.lib kernel32.lib user32.lib gdi32.lib > winspool.lib comd > lg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib > uuid.lib > ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib > msvcrt.lib > libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl58.lib > gnulibc_version='' > Dynamic Linking: > dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' > cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug - > opt:ref,icf - > libpath:"C:\perl58\lib\CORE" -machine:x86' > > > Characteristics of this binary (from libperl): > Compile-time options: MULTIPLICITY PERL_IMPLICIT_CONTEXT > PERL_IMPLICIT_SYS PERL_MALLOC_WRAP > PL_OP_SLAB_ALLOC USE_ITHREADS USE_LARGE_FILES > USE_PERLIO USE_SITECUSTOMIZE > Locally applied patches: > ActivePerl Build 817 [257965] > Iin_load_module moved for compatibility with build 806 > PerlEx support in CGI::Carp > Less verbose ExtUtils::Install and Pod::Find > Patch for CAN-2005-0448 from Debian with modifications > Partly reverted 24733 to preserve binary compatibilty > 27528 win32_pclose() error exit doesn't unlock mutex > 27527 win32_async_check() can loop indefinitely > 27515 ignore directories when searching @INC > 27359 Fix -d:Foo=bar syntax > 27210 Fix quote typo in c2ph > 27203 Allow compiling swigged C++ code > 27200 Make stat() on Windows handle trailing slashes correctly > 27194 Get perl_fini() running on HP-UX again > 27133 Initialise lastparen in the regexp structure > 27034 Avoid "Prototype mismatch" warnings with autouse > 26970 Make Passive mode the default for Net::FTP > 26921 Avoid getprotobyname/number calls in IO::Socket::INET > 26897,26903 Make common IPPROTO_* constants always available > 26670 Make '-s' on the shebang line parse -foo=bar switches > 26379 Fix alarm() for Windows 2003 > 26087 Storable 0.1 compatibility > 25861 IO::File performace issue > 25084 long groups entry could cause memory exhaustion > 24699 ICMP_UNREACHABLE handling in Net::Ping > Built under MSWin32 > Compiled at Mar 20 2006 17:54:25 > @INC: > C:/perl58/lib > C:/perl58/site/lib > . > > C:\Documents and Settings\Me>
This is actually a duplicate of RT #7343. I have included a patch there which fixes this bug.
From: SMPETERS [...] cpan.org
On Wed Oct 18 10:01:26 2006, SMPETERS wrote: Show quoted text
> On Fri Aug 13 08:48:24 2004, SMPETERS wrote:
> > The following error was received from my install of XML::RSS 1.05 on > > Windows NT 4.0. > > > > not ok 14 - t/2.0-generated.xml has '1583' characters. > > # Failed test (t/2.0-generate.t at line 106) > > # got: '1583' > > # expected: '1535' > > # Looks like you failed 1 tests of 25. > > > > The error is caused by a bug in the test script. On UNIX (and Cygwin > > where it also installs just fine), the end of line character is a line > > feed "\n" character. On Windows, however, its a carriage return and a > > line feed character "\r\n". The test where the error occurs is checking > > to see if size of the generated XML file is the size expected. The size > > its expecting is 1535 bytes. On Windows, it gets 1583. The file is 49 > > lines long. The difference between the two is 49 bytes. It appears > > that the test does not take into account the different line endings when > > calculating the expected size.
> > Actually, the following patch fixes this problem. > > $ diff -u lib/XML/RSS.pm.old lib/XML/RSS.pm > --- lib/XML/RSS.pm.old 2006-10-18 08:59:37.656250000 -0500 > +++ lib/XML/RSS.pm 2006-10-18 08:58:31.156250000 -0500 > @@ -1611,6 +1611,7 @@ > sub save { > my ($self,$file) = @_; > open(OUT,">$file") || croak "Cannot open file $file for write: $!"; > + binmode OUT if $^O =~ /win32/i; > print OUT $self->as_string; > close OUT; > }
Please ignore this patch. Please use the patch in RT #11124 instead. Thanks!
Show quoted text
> This is actually a duplicate of RT #7343. I have included a patch there > which fixes this bug.
Please use the patch in RT #11124 instead. Thanks!
Thanks, committed to SVN (r7956). It will be part of the next release (1.11). - ask