Skip Menu |

This queue is for tickets about the Text-BibTeX CPAN distribution.

Report information
The Basics
Id: 68696
Status: resolved
Priority: 0/
Queue: Text-BibTeX

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

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



Subject: bib.t fails on MSWin32 as tmpnam invalid
t/bib.t fails as tmpnam returns a useless filename. I suggest attached patch as an alternative. with the fix, tests all pass. thanks for the work on this module.
Subject: text-bibtex.diff
--- Text-BibTeX-0.55/t/bib.t Tue Apr 26 01:58:54 2011 +++ ../Text-BibTeX-0.55/t/bib.t Wed Jun 8 15:10:41 2011 @@ -4,7 +4,20 @@ use vars qw($DEBUG); use IO::Handle; -use POSIX qw(tmpnam); +BEGIN { + # setup a safe temp name for win32 + if ($^O =~ /Win32/) { + no strict 'refs'; + my $i = 0; + *tmpnam = sub { + return $$.$i++; + }; + } + else { + # for other platforms use Posix tmpnam + eval "use Posix qw(tmpnam);"; + } +} use Test::More tests => 42; @@ -40,7 +53,7 @@ # Entry objects blessed into a structured entry class, so start # by creating the file to parse. my $fn = tmpnam . ".bib"; -open F, '>', $fn || die "couldn't create $fn: $!\n"; +open F, '>', $fn or die "couldn't create $fn: $!\n"; print F $entries; close F;
On Tue Jun 07 23:11:49 2011, AJGOUGH wrote: Show quoted text
> t/bib.t fails as tmpnam returns a useless filename. I suggest attached > patch as an alternative. > > with the fix, tests all pass.
Hello. Do you have any idea if File::Temp would work correctly under Windows? I think so and I would prefer to use it... Cheers
On Wed Jun 08 04:37:44 2011, AMBS wrote: Show quoted text
> On Tue Jun 07 23:11:49 2011, AJGOUGH wrote:
> > t/bib.t fails as tmpnam returns a useless filename. I suggest attached > > patch as an alternative. > > > > with the fix, tests all pass.
> > Hello. > > Do you have any idea if File::Temp would work correctly under Windows? I > think so and I would prefer to use it...
Hello. Uploaded version 0.56 to CPAN using File::Temp. Can you please check it in your system? Thank you! Alberto PS: You can use the new metacpan to get a link to the tarball before all mirrors sync: http://beta.metacpan.org/search?q=Text%3A%3ABibTeX
Fixed.
On Mon Jun 20 07:19:50 2011, AMBS wrote: Show quoted text
> Fixed.
Yep, that's working now. Thanks. Alex