Skip Menu |

This queue is for tickets about the Compress-Zlib CPAN distribution.

Report information
The Basics
Id: 29215
Status: resolved
Priority: 0/
Queue: Compress-Zlib

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

Bug Information
Severity: (no value)
Broken in: 2.005
Fixed in: 2.007



Subject: API and documentation contradict each other; undocumented behaviour changes after the 1.x->2.x transition
Hi, I am a member of the Debian pkg-perl group - We are the maintainers for Compress::Zlib in the Debian GNU/Linux distribution. Magnus Holmgren noticed that, after the 2.x transition, the documentation contradicts the actual API. Some behaviour as changed (which is understandable after a major transition), but the documentation still points what was true before. I'm reproducing his bug report here - For further correspondence, don't hesitate to mail our BTS directly (440943@bugs.debian.org), or check the status via the web interface (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=440943). Package: libcompress-zlib-perl Version: 2.005-3 Severity: important Tags: upstream Compress::Zlib(3pm): $gz->gzclose Closes the compressed file. Any pending data is flushed to the file before it is closed. Returns 1 on success, 0 on failure. The actual code: sub Compress::Zlib::gzFile::gzclose { my $self = shift ; my $gz = $self->[0] ; my $status = $gz->close() ; _save_gzerr($gz); return ! $status ; } IO::Compress::Gzip(3pm): close $z->close() ; close $z ; Returns true on success, otherwise 0. Compress::Zlib::gzFile::gzclose inverts the result from the underlying call, thus it returns 0 on success, 1 on failure. Contrary to the documentation. On the other hand, Compress::Zlib::gzFile::gzflush() does indeed return 1 on success and 0 on failure, which is the opposite of what versions before 2.0 did, thus potentially breaking many applications. Neither README nor changelog documents the change. I haven't checked all subroutines, but gzwrite() and gzread() seem to work the same. -- Magnus Holmgren holmgren@lysator.liu.se
RT-Send-CC: holmgren [...] lysator.liu.se
Hi Magnus, good catch. I thought I had sorted out all the version 1 compatibility issues. I'll double check that the return values for each of the Compress::Zlib public functions/methods match with version 1.x and make sure the documentation matches the code. cheer & thanks for taking the time to report this issue. Paul