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: os.path.join() return wrong value in windows
Type: behavior Stage: resolved
Components: Windows Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: eryksun, paul.moore, steve.dower, tim.golden, triquang, zach.ware
Priority: normal Keywords:

Created on 2017-09-28 11:09 by triquang, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (2)
msg303216 - (view) Author: Quang Nguyen (triquang) Date: 2017-09-28 11:09
In windows if we use os.path.join('C:\\Test\\UnitTest', '/Page') ==> It returns 'C:/Page' ==> It should be 'C:\\Test\\UnitTest/Page'.
msg303223 - (view) Author: Eryk Sun (eryksun) * (Python triager) Date: 2017-09-28 11:33
This is explained in the docs:

    Join one or more path components intelligently.... If a 
    component is an absolute path, all previous components are 
    thrown away and joining continues from the absolute path 
    component. On Windows, the drive letter is not reset when 
    an absolute path component (e.g., r'\foo') is encountered.
History
Date User Action Args
2022-04-11 14:58:52adminsetgithub: 75798
2017-09-28 11:33:46eryksunsetstatus: open -> closed

type: behavior

nosy: + eryksun
messages: + msg303223
resolution: not a bug
stage: resolved
2017-09-28 11:09:21triquangcreate