Re: 3.0rc3: 'os.extsep' gone ... ?

2008-11-25 Thread Lawrence D'Oliveiro
Terry Reedy wrote:

 The doc for os.path begins This module implements some useful functions
 on pathnames.

os.path contains functions that work differently on different systems. It is in 
fact a variable that is initialized to point to posixpath, ntpath etc as 
appropriate for the current system 
http://docs.python.org/library/undoc.html#platform-specific-modules.
--
http://mail.python.org/mailman/listinfo/python-list


Re: 3.0rc3: 'os.extsep' gone ... ?

2008-11-24 Thread Paul Boddie
On 24 Nov, 08:43, Martin v. Löwis [EMAIL PROTECTED] wrote:

 That doesn't really explain it. It always was os.path.extsep,
 but it *also* was os.extsep.

I've always known it as the former; a perusal of the Python repository
would probably indicate when it became exposed in the os module
itself. Support for extension separators (extsep and splitext) has
always been somewhat lacklustre in the os(.path) module, perhaps due
to complicated filename syntax from operating systems like VMS, but
it'd be good to improve this support in future, I think.

Paul
--
http://mail.python.org/mailman/listinfo/python-list


Re: 3.0rc3: 'os.extsep' gone ... ?

2008-11-24 Thread Terry Reedy

Christian Heimes wrote:

bMotu wrote:

IDLE 2.6

import os
os.extsep

'.'
running XP this result is fine ... !

IDLE 3.0rc3

import os
os.extsep

Traceback (most recent call last):
  File pyshell#1, line 1, in module
os.extsep
AttributeError: 'module' object has no attribute 'extsep'

why is this attribute gone in 3.0rc3 ?

where is this documented ?


It's now os.path.extsep.


In 3.0, os.curdir, os.pardir, os.sep, os.altsep, os.pathsep, os.defpath, 
and os.devnull are also in os.path. (Hurray for set intersection.) 
os.extset was in os.path and is documented to still be so, but was 
removed.  os.linesep, inconsistently, never was in os.path.  I think 
either all or none should be duplicated.


The doc for os.path begins This module implements some useful functions 
on pathnames.  The duplication of the sysinfo constants is not 
mentioned!  So if they are only in one place, it should be os, not 
os.path.


The name 'stat' is in both, but is bound to different objects (built-in 
function versus module).


Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list


Re: 3.0rc3: 'os.extsep' gone ... ?

2008-11-24 Thread Martin v. Löwis
 That doesn't really explain it. It always was os.path.extsep,
 but it *also* was os.extsep.
 
 I've always known it as the former

Same here, but see below.

 a perusal of the Python repository
 would probably indicate when it became exposed in the os module
 itself.

That's indeed easier to answer than finding out when it was removed
for 3k, and by whom. It was provided in its current form with

r31426 | montanaro | 2003-02-14 20:35:31 +0100 (Fr, 14. Feb 2003) | 3 lines
Migrate definitions of several platform-dependent path-related variables
into the relevant path modules.  See patch #686397.

So they were migrated *into* the specific modules in 2003.

Before, they were all conditionally defined based on the platform, in
os.py itself.

So I must be misremembering - in 2.2 and earlier, they were only
in the os module. So it was *not* always os.path.extsep.

Perhaps this gives the rationale for the change - migration into the
platform modules is now complete.

Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list


Re: 3.0rc3: 'os.extsep' gone ... ?

2008-11-24 Thread Terry Reedy

Martin v. Löwis wrote:


Perhaps this gives the rationale for the change - migration into the
platform modules is now complete.


Except that, as I posted earlier, extsep is the *only* os system info 
constant that has been removed from os.


--
http://mail.python.org/mailman/listinfo/python-list


Re: 3.0rc3: 'os.extsep' gone ... ?

2008-11-24 Thread Martin v. Löwis
 Except that, as I posted earlier, extsep is the *only* os system info
 constant that has been removed from os.

Ah, this gives another clue:



r57097 | skip.montanaro | 2007-08-16 16:35:24 +0200 (Do, 16. Aug 2007) |
1 line

Remove RISCOS support


Still not sure though why extsep was removed in this change...

Not that I regret it's gone - it was a useless constant, anyway,
as the extension separator is '.' on all interesting systems.

Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list


Re: 3.0rc3: 'os.extsep' gone ... ?

2008-11-24 Thread skip

Martin 

Martin r57097 | skip.montanaro | 2007-08-16 16:35:24 +0200 (Do, 16. Aug 
2007) |
Martin 1 line

Martin Remove RISCOS support
Martin 


Yeah, that was me.

Martin Not that I regret it's gone - it was a useless constant, anyway,
Martin as the extension separator is '.' on all interesting systems.

Except if you diff r57096 and r57097 I suspect you'll find that it was
different in RISCOS.  Perhaps it was only ever added to Python to support
that platform.

Skip
--
http://mail.python.org/mailman/listinfo/python-list


Re: 3.0rc3: 'os.extsep' gone ... ?

2008-11-24 Thread Martin v. Löwis
 Martin Not that I regret it's gone - it was a useless constant, anyway,
 Martin as the extension separator is '.' on all interesting systems.
 
 Except if you diff r57096 and r57097 I suspect you'll find that it was
 different in RISCOS. 

I did, and interestingly enough, you won't find that. It was different
indeed - but you need to look r57116 to find out what happened to
riscospath.py (as only then, you removed the specific path module).

In any case - if the intention was that extsep is now not supported
anymore, it should have been removed from the other *path modules
as well (along with removing it from the documentation).

Regards,
Martin

--
http://mail.python.org/mailman/listinfo/python-list


Re: 3.0rc3: 'os.extsep' gone ... ?

2008-11-24 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote:
 Martin In any case - if the intention was that extsep is now not
 Martin supported anymore, it should have been removed from the other
 Martin *path modules as well (along with removing it from the
 Martin documentation).
 
 No, that wasn't my intent.  I was speculating that os.extsep turned up in
 Python when RISCOS support was added.  At the time I removed support I
 wasn't thinking in terms of getting rid of that attribute.

I don't quite understand. Yes, the variable was added when RISCOS
support was introduced. So when RISCOS support is removed, it seems
natural to remove the variable also. You chose not to - so why did you
then remove it from the os module?

Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list


Re: 3.0rc3: 'os.extsep' gone ... ?

2008-11-24 Thread Lawrence D'Oliveiro
Martin v. Löwis wrote:

 That doesn't really explain it. It always was os.path.extsep,
 but it *also* was os.extsep.
 
 I don't know the rationale for this change myself, either.

Probably because it's considered platform-specific.
--
http://mail.python.org/mailman/listinfo/python-list


3.0rc3: 'os.extsep' gone ... ?

2008-11-23 Thread bMotu
IDLE 2.6
 import os
 os.extsep
'.'
running XP this result is fine ... !

IDLE 3.0rc3
 import os
 os.extsep
Traceback (most recent call last):
  File pyshell#1, line 1, in module
os.extsep
AttributeError: 'module' object has no attribute 'extsep'

why is this attribute gone in 3.0rc3 ?

where is this documented ?

ciao, motu
--
http://mail.python.org/mailman/listinfo/python-list


Re: 3.0rc3: 'os.extsep' gone ... ?

2008-11-23 Thread alex23
On Nov 24, 9:59 am, bMotu [EMAIL PROTECTED] wrote:
 AttributeError: 'module' object has no attribute 'extsep'

 why is this attribute gone in 3.0rc3 ?

 where is this documented ?

According to the 3.0 docs, it should still be there. But I'm finding
the same with rc2. Looks like a bug.

It's available as os.path.extsep though.
--
http://mail.python.org/mailman/listinfo/python-list


Re: 3.0rc3: 'os.extsep' gone ... ?

2008-11-23 Thread Terry Reedy

alex23 wrote:

On Nov 24, 9:59 am, bMotu [EMAIL PROTECTED] wrote:

AttributeError: 'module' object has no attribute 'extsep'

why is this attribute gone in 3.0rc3 ?

where is this documented ?


According to the 3.0 docs, it should still be there. But I'm finding
the same with rc2. Looks like a bug.

It's available as os.path.extsep though.


Reported in http://bugs.python.org/issue4401

--
http://mail.python.org/mailman/listinfo/python-list


Re: 3.0rc3: 'os.extsep' gone ... ?

2008-11-23 Thread Christian Heimes

bMotu wrote:

IDLE 2.6

import os
os.extsep

'.'
running XP this result is fine ... !

IDLE 3.0rc3

import os
os.extsep

Traceback (most recent call last):
  File pyshell#1, line 1, in module
os.extsep
AttributeError: 'module' object has no attribute 'extsep'

why is this attribute gone in 3.0rc3 ?

where is this documented ?


It's now os.path.extsep.

Christian

--
http://mail.python.org/mailman/listinfo/python-list


Re: 3.0rc3: 'os.extsep' gone ... ?

2008-11-23 Thread Martin v. Löwis
Christian Heimes wrote:
 bMotu wrote:
 IDLE 2.6
 import os
 os.extsep
 '.'
 running XP this result is fine ... !

 IDLE 3.0rc3
 import os
 os.extsep
 Traceback (most recent call last):
   File pyshell#1, line 1, in module
 os.extsep
 AttributeError: 'module' object has no attribute 'extsep'

 why is this attribute gone in 3.0rc3 ?

 where is this documented ?
 
 It's now os.path.extsep.

That doesn't really explain it. It always was os.path.extsep,
but it *also* was os.extsep.

I don't know the rationale for this change myself, either.

I doubt it is documented anywhere, nor do I think it should;
there won't be ever a complete list of changes between 2.x
and 3.x.

Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list