Message9793

Author jeff.allen
Recipients jeff.allen
Date 2015-04-10.16:10:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1428682227.65.0.332433300733.issue2307@psf.upfronthosting.co.za>
In-reply-to
Content
This (https://hg.python.org/jython/rev/60972a7a26c5) passes on my C: drive, but on D: fails my especially cruel test:
======================================================================
FAIL: test_windows_getcwd_ensures_drive_letter (__main__.WindowsChdirTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\hg\jython-int\dist\Lib\test\test_chdir.py", line 227, in test_windows_getcwd_ensures_drive_letter
    self.assertEqual(os.path.normcase(os.getcwd()),
AssertionError: 'd:' != 'd:\\hg\\jython-int'

----------------------------------------------------------------------

Windows has this awkward feature that every drive has its own current working directory, and if you just call os.chdir('d:') you ought to land in the one previously defined (with os.chdir or in the shell) for the d-drive. Under #2117 we got this as close to CPython as possible using java.io.File (see https://hg.python.org/jython/rev/f553f6a07fb5#l3.74). On the plus side, I think it would be easier to get right with the help of Path.getRoot() and FileSystem.getRootDirectories().
History
Date User Action Args
2015-04-10 16:10:27jeff.allensetmessageid: <1428682227.65.0.332433300733.issue2307@psf.upfronthosting.co.za>
2015-04-10 16:10:27jeff.allensetrecipients: + jeff.allen
2015-04-10 16:10:27jeff.allenlinkissue2307 messages
2015-04-10 16:10:27jeff.allencreate