delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/08/30/16:00:20

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <4133873F.8090606@alltel.net>
Date: Mon, 30 Aug 2004 14:59:59 -0500
From: Ken Dibble <kdibbleNOSPAM AT alltel DOT net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Python os.path.join inconsistency?
References: <Pine DOT SOL DOT 4 DOT 31 DOT 0408301317480 DOT 11638-100000 AT dandenong DOT cs DOT umass DOT edu> <413384A1 DOT 7080509 AT alltel DOT net> <20040830195455 DOT GC15021 AT trixie DOT casa DOT cgf DOT cx>
In-Reply-To: <20040830195455.GC15021@trixie.casa.cgf.cx>

Live and Learn.

I guess my limited experience (including not being a windows programmer)
colored my perception.

I had never been able to get any Windows variant I was exposed to,
to accept a forward slash.  So much for my recall device of
Unix Forward, Windows Backward.

Regards,
Ken

Christopher Faylor wrote:

>On Mon, Aug 30, 2004 at 02:48:49PM -0500, Ken Dibble wrote:
>  
>
>>I don't know anything about Python but I do know that
>>
>>'c:/foo' and  'c:/foo/bar' are not windows paths.
>>    
>>
>
>c:/foo and c:/foo/bar are perfectly acceptable windows paths.  Some
>windows utilities don't accept this style of window path on the command
>line but they are recognized by all of the windows functions which use
>paths.
>
>I don't know python but I am not surprised that a cygwin version of
>python would be "confused" by the use of colons in path names since
>avoidance of that kind of path is one of the main reasons for cygwin's
>existence.  The cygwin DLL does try to handle dos paths correctly but
>that doesn't mean that a UNIX program which manipulates UNIX path names
>will be happy to see them.
>
>cgf
>
>  
>
>>c:\foo and c:\foo\bar are.
>>
>>This probably doesn't help though.
>>
>>Andres Corrada-Emmanuel wrote:
>>    
>>
>>>I just ran across an inconsistency on the os.path module for Cygwin
>>>Python, specifically os.path.join:
>>>
>>>      
>>>
>>>>>>import os.path
>>>>>>os.path.join( 'c:/foo', 'c:/foo/bar' )
>>>>>>      
>>>>>>
>>>>>>            
>>>>>>
>>>'c:foo/c:/foo/bar'
>>>
>>>
>>>      
>>>
>>>>>>os.path.join( '/cygdrive/c/foo', '/cygdrive/c/foo/bar' )
>>>>>>      
>>>>>>
>>>>>>            
>>>>>>
>>>'/cygdrive/c/foo/bar'
>>>
>>>The first incantation of os.path.join with Windows style paths violates
>>>the documentation statement that os.path.join neglects previous paths once
>>>it encounters an absolute path.
>>>
>>>Does it not seem inconsistent that if Cygwin Python understands how to
>>>execute:
>>>
>>>file( 'c:/foo/bar' ) as well as file( '/cygdrive/c/foo/bar' )
>>>
>>>it should also treat Windows style paths correctly with os.path.join? In
>>>other words, it seems that Python on Cygwin cannot default to using
>>>posixpath.py for os.path. It's got to be posixpath.py with some additional
>>>magic to get it to do os.path.join correctly.
>>>
>>>How does one go about submitting a patch for Cygwin Python?
>>>
>>>Andres Corrada-Emmanuel
>>>Senior Research Fellow
>>>Information Extraction and Synthesis Laboratory
>>>University of Massachusetts, Amherst
>>>
>>>
>>>
>>>      
>>>
>>--
>>Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>>Problem reports:       http://cygwin.com/problems.html
>>Documentation:         http://cygwin.com/docs.html
>>FAQ:                   http://cygwin.com/faq/
>>
>>    
>>
>
>--
>Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>Problem reports:       http://cygwin.com/problems.html
>Documentation:         http://cygwin.com/docs.html
>FAQ:                   http://cygwin.com/faq/
>
>
>  
>


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019