Re: os.path.normcase rationale?

2010-09-24 Thread Chris Withers
On 21/09/2010 01:02, Steven D'Aprano wrote: On Mon, 20 Sep 2010 19:45:37 +0100, Chris Withers wrote: Well, no, that doesn't feel right. Normalisation of case, for me, means give me the case as the filesystem thinks it should be, What do you mean the filesystem? If I look at the available

Re: os.path.normcase rationale?

2010-09-24 Thread Ben Finney
Chris Withers ch...@simplistix.co.uk writes: On 21/09/2010 01:02, Steven D'Aprano wrote: What do you mean the filesystem? If I look at the available devices on my system now, I see: 2 x FAT-32 filesystems 1 x ext2 filesystem 3 x ext3 filesystems 1 x NTFS filesystem 1 x UDF

Re: os.path.normcase rationale?

2010-09-21 Thread Nobody
On Tue, 21 Sep 2010 10:12:27 +1000, Ben Finney wrote: Another is that filesystems don't have a standard way of determining whether they are case-sensitive. The operating system's driver for that particular filesystem knows, I'm not even sure that's true; with a networked filesytem, some parts

Re: os.path.normcase rationale?

2010-09-20 Thread Chris Withers
On 15/09/2010 22:12, Ben Finney wrote: Chris Withersch...@simplistix.co.uk writes: I'm curious as to why, with a file called Foo.txt os.path.normcase('FoO.txt') will return foo.txt rather than Foo.txt? What kind of answer are you looking for? A direct answer would be: it does that because

Re: os.path.normcase rationale?

2010-09-20 Thread Chris Withers
On 16/09/2010 00:14, Gregory Ewing wrote: Ben Finney wrote: it doesn't matter what the case is, so there's no need for anything more complex than all lowercase. Also doing what was suggested would require looking at what's in the file system, which would be a lot of bother to go to for no

Re: os.path.normcase rationale?

2010-09-20 Thread Chris Withers
On 17/09/2010 03:35, Nobody wrote: os.path.normcase(path) Normalize the case of a pathname. On Unix and Mac OS X, this returns the path unchanged; on case-insensitive filesystems, it converts the path to lowercase. On Windows, it also converts forward slashes to backward

Re: os.path.normcase rationale?

2010-09-20 Thread Steven D'Aprano
On Mon, 20 Sep 2010 19:45:37 +0100, Chris Withers wrote: Well, no, that doesn't feel right. Normalisation of case, for me, means give me the case as the filesystem thinks it should be, What do you mean the filesystem? If I look at the available devices on my system now, I see: 2 x FAT-32

Re: os.path.normcase rationale?

2010-09-20 Thread Ben Finney
Chris Withers ch...@simplistix.co.uk writes: What I expected it to mean was give me what the filesystem thinks this file path is, which doesn't seem unreasonable and would be a lot more useful, no matter the platform... Two problems with that. One is that the entry specified by the path may

Re: os.path.normcase rationale?

2010-09-20 Thread Ethan Furman
Steven D'Aprano wrote: On Mon, 20 Sep 2010 19:45:37 +0100, Chris Withers wrote: Well, no, that doesn't feel right. Normalisation of case, for me, means give me the case as the filesystem thinks it should be, What do you mean the filesystem? Well, if it were me, it would be either the

Re: os.path.normcase rationale?

2010-09-16 Thread Nobody
On Wed, 15 Sep 2010 14:49:09 +0100, Chris Withers wrote: I'm curious as to why, with a file called Foo.txt os.path.normcase('FoO.txt') will return foo.txt rather than Foo.txt? normcase() doesn't look at the filesystem; it's just string manipulation. --

Re: os.path.normcase rationale?

2010-09-16 Thread Nobody
On Thu, 16 Sep 2010 07:12:16 +1000, Ben Finney wrote: Yes, I know the behaviour is documented The docstring is fairly poor, IMO. You might want to submit a bug report to improve it. The description in the library documentation is misleading: os.path.normcase(path) Normalize the case of

os.path.normcase rationale?

2010-09-15 Thread Chris Withers
Hi All, I'm curious as to why, with a file called Foo.txt os.path.normcase('FoO.txt') will return foo.txt rather than Foo.txt? Yes, I know the behaviour is documented, but I'm wondering if anyone can remember the rationale for that behaviour? cheers, Chris -- Simplistix - Content

Re: os.path.normcase rationale?

2010-09-15 Thread Ben Finney
Chris Withers ch...@simplistix.co.uk writes: I'm curious as to why, with a file called Foo.txt os.path.normcase('FoO.txt') will return foo.txt rather than Foo.txt? What kind of answer are you looking for? A direct answer would be: it does that because on case-insensitive filesystems, it

Re: os.path.normcase rationale?

2010-09-15 Thread Gregory Ewing
Ben Finney wrote: it doesn't matter what the case is, so there's no need for anything more complex than all lowercase. Also doing what was suggested would require looking at what's in the file system, which would be a lot of bother to go to for no good reason, and would fail for paths that