This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Cygwin, python and abspath()
- From: Mikko Rapeli <mikko dot rapeli at iki dot fi>
- To: cygwin at cygwin dot com
- Date: Tue, 16 Jul 2013 18:19:01 +0300
- Subject: Re: Cygwin, python and abspath()
- References: <20130716150106 dot GI23038 at lakka dot kapsi dot fi>
On Tue, Jul 16, 2013 at 06:01:06PM +0300, Mikko Rapeli wrote:
> Hi,
>
> Does anyone know why os.path.abspath() in python on cygwin is creating
> invalid path names when given these cygwin compatible dos path names?
>
> $ pwd
> /cygdrive/c/temp
>
> $ python -c "import os; os.path.abspath('/cygdrive/c/temp')"
> /cygdrive/c/temp
>
> $ python -c "import os; os.path.abspath('c:/temp')"
> /cygdrive/c/temp/c:/temp
>
> I have cmake generating the dos compatible path names and they work with
> all other cygwin utilities that I've used.
Perl seems to understand both ways as absolute paths:
$ perl -e 'use File::Spec; print File::Spec->rel2abs("c:/temp")'
c:/temp
$ perl -e 'use File::Spec; print File::Spec->rel2abs("/cygdrive/c/temp")'
/cygdrive/bin/perl
$ which perl
/usr/bin/perl
$ perl --version | head -2 | tail -1
This is perl 5, version 14, subversion 2 (v5.14.2) built for cygwin-thread-multi-64int
-Mikko
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple