Skip Menu |

This queue is for tickets about the PathTools CPAN distribution.

Report information
The Basics
Id: 47755
Status: open
Priority: 0/
Queue: PathTools

People
Owner: Nobody in particular
Requestors: jkeenan [...] cpan.org
rlucas [...] rlucas.net
Cc:
AdminCc:

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



Subject: _perl_abs_path oddly returns empty string on failure
Date: Thu, 9 Jul 2009 13:53:18 -0700
To: bug-PathTools [...] rt.cpan.org
From: Randall Lucas <rlucas [...] rlucas.net>
In Cwd.pm 3.2701, line 501, _perl_abs_path(), there are a couple of execution paths that could lead to a return ''; Specifically, if you can't stat the $start path, it carps and returns ''; unless (@cst = stat( $start )) { _carp("stat($start): $!"); return ''; } I can't see that the correct behavior is specified anywhere, but there are several other places that suggest that it should die or croak instead of returning empty. For example, in fast_abs_path, failure to -e $path gets a croak. unless (-e $path) { _croak("$path: No such file or directory"); } The reason I bring this up is that it appears that File::pushd 1.00 relies upon an eval {}; to check for the success of abs_path. On Mac OS X, abs_path ends up using the _perl_abs_path version, and returns '' without dying for a bogus directory. I am also reporting this for File::pushd, but it may be worth standardizing the behavior in Cwd so that failure dies or croaks. Mac OS X 10.5.7 (9J61) perl, v5.8.8 built for darwin-thread-multi-2level Cwd.pm 3.2701
Subject: Re: [rt.cpan.org #47755] AutoReply: _perl_abs_path oddly returns empty string on failure
Date: Thu, 9 Jul 2009 15:05:30 -0700
To: bug-PathTools [...] rt.cpan.org
From: Randall Lucas <rlucas [...] rlucas.net>
For reference, I've more fully explained the downstream problem in File::pushd that arises due to this behavior in [rt.cpan.org #47759]. I've also addressed that particular bug with a patch that fixes File::pushd to work OK even with the _perl_abs_path issue as-is.
On Thu Jul 09 18:05:49 2009, rlucas@rlucas.net wrote: Show quoted text
> For reference, I've more fully explained the downstream problem in > File::pushd that arises due to this behavior in [rt.cpan.org #47759]. I've > also addressed that particular bug with a patch that fixes File::pushd to > work OK even with the _perl_abs_path issue as-is.
Are there issues that still need to be addressed in this ticket? Thank you very much. Jim Keenan
Subject: Re: [rt.cpan.org #47755] _perl_abs_path oddly returns empty string on failure
Date: Sun, 24 Nov 2013 14:23:29 -0800
To: bug-PathTools [...] rt.cpan.org
From: Randall Lucas <rlucas [...] rlucas.net>
Jim, I haven't worked with the software in question for several years now.  I just took a peek at Cwd.pm and _perl_abs_path still deals with problems by returning ''. The other *abs_path approaches tend to croak or die instead. This should probably be harmonized to prevent portability surprises, like I had with code up the stack (File::pushd) stopping working on a different platform due to different abs_path implemetation failing differently. But no, nothing pressingly broken for me. Best, Randall On Sat, Nov 23, 2013 at 5:51 PM, James E Keenan via RT <bug-PathTools@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=47755 > > > On Thu Jul 09 18:05:49 2009, rlucas@rlucas.net wrote:
>> For reference, I've more fully explained the downstream problem in >> File::pushd that arises due to this behavior in [rt.cpan.org #47759]. I've >> also addressed that particular bug with a patch that fixes File::pushd to >> work OK even with the _perl_abs_path issue as-is.
> > > Are there issues that still need to be addressed in this ticket? > > Thank you very much. > Jim Keenan
The other problem is that the perl version returns the empty string whereas the XS version of abs_path returns undef, so the API isn't consistent there, either.
+1, just ran into this too. On Fri Jul 10 00:53:44 2009, rlucas@rlucas.net wrote: Show quoted text
> In Cwd.pm 3.2701, line 501, _perl_abs_path(), there are a couple of > execution paths that could lead to a > > return ''; >
another problem that _perl_abs_path do this: # probably a permissions issue. Try the native command. require File::Spec; return File::Spec->rel2abs( $start, _backtick_pwd() ); which will return correct (sometimes?) directory absolute path. but this path will be unreadable, thus unexisting. On Sun Dec 15 19:08:18 2013, vsespb wrote: Show quoted text
> +1, just ran into this too. > > On Fri Jul 10 00:53:44 2009, rlucas@rlucas.net wrote:
> > In Cwd.pm 3.2701, line 501, _perl_abs_path(), there are a couple of > > execution paths that could lead to a > > > > return ''; > >