Message2724

Author pekka.klarck
Recipients
Date 2007-05-20.09:56:20
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Charlie, you are absolutely right. I promise to test my pathches better in the future. Just need to get Jython devenv somehow setup to my work machine too since it's the only Windows I have.

I actually first implemented this patch using following test. Unfortunately that's not good either because os.curdir may also be '/' in posix and in that case the check below would return true.

File(os.curdir.upper()).getCanonicalPath() == File(os.curdir.lower()).getCanonicalPath()


You mentioned temp files and I got an idea that perhaps this could be implemented using the system temp directory -- there's no need to create it so there's no error checking required. Based on a little prototyping on console, copied below, it seems to work.

C:\Temp>jython
Jython 2.2b2 on java1.5.0_11
Type "copyright", "credits" or "license" for more information.
>>> from java.io import File
>>> from java.lang import System
>>> tmp = System.getProperty('java.io.tmpdir')
'C:\\DOCUME~1\\pekkalau\\LOCALS~1\\Temp\\'
>>> File(tmp.upper()).getCanonicalPath()
'C:\\Documents and Settings\\pekkalau\\Local Settings\\Temp'
>>> File(tmp.lower()).getCanonicalPath()
'C:\\Documents and Settings\\pekkalau\\Local Settings\\Temp'


Unfortunately I don't have time to write a new patch for this because I'm going to a business trip to China for two weeks today. I only take my work machine with me so I don't have Jython devenv with me.
History
Date User Action Args
2008-02-20 17:18:43adminlinkissue1718975 messages
2008-02-20 17:18:43admincreate