[New-bugs-announce] [issue26064] directory is getting separated

Sagar Kar report at bugs.python.org
Sat Jan 9 13:25:26 EST 2016


New submission from Sagar Kar:

In [108]: os.mkdir('newdir') # make new dir
In [140]: p = os.path.abspath('newdir')

In [141]: p
Out[141]: '/media/sagarkar10/sdrive/programing/python/SciPy/scipy-notebook/newdir'

## here 'newdir' is also a directory with a file inside

In [143]: os.path.dirname(p)
Out[143]: '/media/sagarkar10/sdrive/programing/python/SciPy/scipy-notebook'

## but os.path.dirname() dont show it under directory it treats as if its a file and till the last '/' is the directory
and also 

In [145]: os.path.basename(p)
Out[145]: 'newdir'

## basename shows it

----------
components: Extension Modules
messages: 257849
nosy: sagarkar10
priority: normal
severity: normal
status: open
title: directory is getting separated
type: enhancement
versions: Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26064>
_______________________________________


More information about the New-bugs-announce mailing list