This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: directory is getting separated
Type: enhancement Stage: resolved
Components: Extension Modules Versions: Python 3.4
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: SilentGhost, sagarkar10
Priority: normal Keywords:

Created on 2016-01-09 18:25 by sagarkar10, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (2)
msg257849 - (view) Author: Sagar Kar (sagarkar10) Date: 2016-01-09 18:25
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
msg257850 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2016-01-09 18:30
It behaves exactly as described in documentation, the only thing I could suggest is to re-read the following for details: https://docs.python.org/3/library/os.path.html#os.path.split
History
Date User Action Args
2022-04-11 14:58:26adminsetgithub: 70252
2016-01-09 18:30:53SilentGhostsetstatus: open -> closed

nosy: + SilentGhost
messages: + msg257850

resolution: not a bug
stage: resolved
2016-01-09 18:25:26sagarkar10create