Skip Menu |
 

This queue is for tickets about the PathTools CPAN distribution.

Report information
The Basics
Id: 27016
Status: resolved
Priority: 0/
Queue: PathTools

People
Owner: Nobody in particular
Requestors: jloverso [...] mathworks.com
Cc:
AdminCc:

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



Subject: File::Spec->tmpdir() autovivifies $ENV{TMPDIR} into existence on Win32 (+FIX)
Download (untitled) / with headers
text/plain 1.3k
Calling File::Spec->tmpdir() on Windows polutes the environment by creating $ENV{TMPDIR} and $ENV{TMP} with an undef value. This happens because tmpdir() passes an array slice of these elements to a function, which autovivifies them into existence. C:\> perl -de0 Loading DB routines from perl5db.pl version 1.28 Editor support available. Enter h or `h h' for help, or `perldoc perldebug' for more help. main::(-e:1): 0 DB<1> use File::Spec DB<2> x grep /^T/, keys %ENV 0 'TEMP' DB<3> x File::Spec->tmpdir 0 'C:\\Temp' DB<4> x grep /^T/, keys %ENV 0 'TEMP' 1 'TMPDIR' 2 'TMP' DB<5> x exists $ENV{TMPDIR} 0 1 DB<6> x defined $ENV{TMPDIR} 0 '' C:\> perl -v This is perl, v5.8.8 built for MSWin32-x86-multi-thread (with 33 registered patches, see perl -V for more detail) Copyright 1987-2006, Larry Wall Binary build 819 [267479] provided by ActiveState http://www.ActiveState.com Built Aug 29 2006 12:42:41 (Running on WinXP SP2) This is caused by line 66 of File/Spec/Win32.pm passing hash elements to a function: sub tmpdir { return $tmpdir if defined $tmpdir; $tmpdir = $_[0]->_tmpdir( @ENV{qw(TMPDIR TEMP TMP)}, 'SYS:/temp', 'C:\system\temp', 'C:/temp', '/tmp', '/' ); I believe changing this as follows fixes the problem: $tmpdir = $_[0]->_tmpdir( (@ENV{qw(TMPDIR TEMP TMP)})[1..3],
Thanks for the report. This is now fixed in the repository. -Ken
From: jloverso [...] mathworks.com
Download (untitled) / with headers
text/plain 276b
On Tue May 08 23:53:46 2007, KWILLIAMS wrote: Show quoted text
> Thanks for the report. This is now fixed in the repository. > > -Ken
I just noticed that this is a duplicate of http://rt.cpan.org/Public/Bug/Display.html?id=15062 Do you plan to made a new release of File::Spec soon?
Subject: Re: [rt.cpan.org #27016] File::Spec->tmpdir() autovivifies $ENV{TMPDIR} into existence on Win32 (+FIX)
Date: Wed, 9 May 2007 21:13:42 -0500
To: bug-PathTools [...] rt.cpan.org
From: Ken Williams <ken [...] mathforum.org>
Download (untitled) / with headers
text/plain 257b
On May 9, 2007, at 10:32 AM, John LoVerso via RT wrote: Show quoted text
> Do you plan to made a new release of File::Spec soon?
Yup, your message re-alerted me to the fact that there were outstanding bugs necessitating a release. Will get it rolled up soon. -Ken
Subject: RE: [rt.cpan.org #27016] File::Spec->tmpdir() autovivifies $ENV{TMPDIR} into existence on Win32 (+FIX)
Date: Thu, 10 May 2007 09:22:19 -0400
To: <bug-PathTools [...] rt.cpan.org>
From: "John LoVerso" <John.LoVerso [...] mathworks.com>
Download (untitled) / with headers
text/plain 645b
Thank you! John Show quoted text
> -----Original Message----- > From: ken@mathforum.org via RT [mailto:bug-PathTools@rt.cpan.org] > Sent: Wednesday, May 09, 2007 10:15 PM > To: John LoVerso > Subject: Re: [rt.cpan.org #27016] File::Spec->tmpdir() > autovivifies $ENV{TMPDIR} into existence on Win32 (+FIX) > > > <URL: http://rt.cpan.org/Ticket/Display.html?id=27016 > > > > On May 9, 2007, at 10:32 AM, John LoVerso via RT wrote: >
> > Do you plan to made a new release of File::Spec soon?
> > Yup, your message re-alerted me to the fact that there were > outstanding bugs necessitating a release. Will get it rolled up soon. > > -Ken > > >


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.