Message 320606 - Python tracker

Message320606

Author emilyemorehouse
Recipients CarlAndersson, emilyemorehouse, serhiy.storchaka
Date 2018-06-27.19:19:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1530127164.74.0.56676864532.issue33968@psf.upfronthosting.co.za>
In-reply-to
Content
The os.path conventions do follow, '' and '.' are not treated the same here either --

>>> os.path.exists('')
False
>>> os.path.exists('.')
True
>>> os.path.isdir('')
False
>>> os.path.isdir('.')
True

The only os.path function that I see as potentially confusing in this discussion is dirname, as that can return an empty string which yields unexpected results when used as an argument for other functions.

>>> os.path.dirname('testdir')
''
>>> os.path.dirname('./testdir')
'.'

However, changing this functionality (e.g. os.path.dirname('testdir') returning '.') would result in backward-compatibility issues that would not be warranted (IMO).


I'll leave the final word to Serhiy to close out as 'not a bug' at his discretion.
History
Date User Action Args
2018-06-27 19:19:24emilyemorehousesetrecipients: + emilyemorehouse, serhiy.storchaka, CarlAndersson
2018-06-27 19:19:24emilyemorehousesetmessageid: <1530127164.74.0.56676864532.issue33968@psf.upfronthosting.co.za>
2018-06-27 19:19:24emilyemorehouselinkissue33968 messages
2018-06-27 19:19:24emilyemorehousecreate