[New-bugs-announce] [issue35223] Pathlib incorrectly merges strings.

Roffild report at bugs.python.org
Mon Nov 12 19:06:16 EST 2018


New submission from Roffild <roffild at gmail.com>:

Code:
import os
print(os.path.join("C:/123\\345", "\\", "folder///filename.bin"))
import pathlib
print(pathlib.PureWindowsPath("C:/123\\345", "\\", "folder///filename.bin"))

Result:
C:\folder///filename.bin
C:\folder\filename.bin

Expected result for Windows:
C:\123\345\folder\filename.bin

The number of slashes should be controlled by the library. Replacing / on \ should also depend on the OS.

----------
components: IO, Library (Lib), Windows
messages: 329776
nosy: Roffild, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Pathlib incorrectly merges strings.
type: behavior
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35223>
_______________________________________


More information about the New-bugs-announce mailing list