Title: cPython/Jython different os.path.isabs() behavior
Type: Severity: normal
Components: Library Versions:
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: pjenvey Nosy List: billiejoex, pjenvey
Priority: normal Keywords:

Created on 2008-01-25.19:31:11 by billiejoex, last changed 2008-06-09.18:09:13 by pjenvey.

msg2064 (view) Author: Giampaolo Rodola' (billiejoex) Date: 2008-01-25.19:31:11
On windows XP prof SP2:

Python 2.3.5 (#62, Feb  8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.path.isabs('/a')
>>> os.path
<module 'ntpath' from 'C:\Python23\lib\ntpath.pyc'>

Jython 2.3a0 on java1.6.0_04
Type "copyright", "credits" or "license" for more information.
>>> import os
>>> os.path.isabs('/a')
>>> os.path
<module 'javapath' from 'C:\dist\Lib\'>
msg2065 (view) Author: Giampaolo Rodola' (billiejoex) Date: 2008-01-25.20:33:36
Another difference: os.path.isabs('\\') on cPython returns True while on Jython returns False.
I guess there are other differences like these.

Note: on Windows '\\' is an alias for the current drive letter. For example: if the current working directory is D:\Documents, os.path.realpath('\\') returns "D:\\" (which is obviously absolute).
msg3048 (view) Author: Philip Jenvey (pjenvey) Date: 2008-02-24.04:24:10
fixed in r4171: we use the platform dependent path module (ntpath on 
Windows) now
msg3262 (view) Author: Giampaolo Rodola' (billiejoex) Date: 2008-06-09.13:26:28
I installed the most updated Jython version from the trunk and I'm still
noticing the same problem.
msg3265 (view) Author: Giampaolo Rodola' (billiejoex) Date: 2008-06-09.17:34:54
It seems that the ntpath module is not actually used:

>>> import os
>>> os.path
<module 'javapath' from 'C:\dist\Lib\'>
msg3266 (view) Author: Philip Jenvey (pjenvey) Date: 2008-06-09.17:39:37
That's the problem you're having then, the fact that ntpath isn't being 
used. I'm not sure why it wouldn't work on your environment. Are you 
sure that's trunk?

What version of Windows are you using? What is the value of 

Here's what I get:

C:\Documents and Settings\Administrator\Desktop\jython-
Jython 2.3a0+ (trunk, Jun 8 2008, 14:43:44)
[Java HotSpot(TM) Client VM (Sun Microsystems Inc.)] on java1.6.0_05
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.path
<module 'ntpath' from 'C:\Documents and 
>>> os.path.isabs('/a')
msg3267 (view) Author: Giampaolo Rodola' (billiejoex) Date: 2008-06-09.17:56:59
You're right, I'm sorry.
I wasn't using the latest trunk version.
A question: what happens on other systems than Windows? Is
still used?
msg3269 (view) Author: Philip Jenvey (pjenvey) Date: 2008-06-09.18:02:26
posixpath is used on everything else but windows -- which is pretty much 
what CPython does (except it checks for os2 and windows ce)

javapath shouldn't be in use by Jython at all, actually (which should 
have told me you're not on trunk). The module is still included for 
backwards compat.

I'll assume the other related bugs are still fixed
Date User Action Args
2008-06-09 18:09:13pjenveysetstatus: open -> closed
resolution: accepted -> fixed
2008-06-09 18:02:27pjenveysetmessages: + msg3269
2008-06-09 17:57:11billiejoexsetmessages: + msg3267
2008-06-09 17:39:38pjenveysetmessages: + msg3266
2008-06-09 17:34:55billiejoexsetmessages: + msg3265
2008-06-09 17:18:17pjenveysetstatus: closed -> open
assignee: pjenvey
resolution: fixed -> accepted
2008-06-09 13:26:30billiejoexsetmessages: + msg3262
2008-02-24 04:24:10pjenveysetstatus: open -> closed
title: cPython/Jython different os.path.isabs() behavior -> cPython/Jython different os.path.isabs() behavior
nosy: + pjenvey
messages: + msg3048
components: + Library, - None
resolution: fixed
2008-01-25 19:31:11billiejoexcreate