[issue41565] from os.path import join join('3', '{:3') return '{:3' in windows

2020-08-18 Thread Eryk Sun
Change by Eryk Sun : -- status: open -> closed type: compile error -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing

[issue41565] from os.path import join join('3', '{:3') return '{:3' in windows

2020-08-18 Thread song super
song super <2262720...@qq.com> added the comment: Think you very much,I am a college student, do not understand these underlying principles, this problem is I wrote a program on Linux, later moved to the windows system found, thank you very much for your answers -- nosy: +2262720766

[issue41565] from os.path import join join('3', '{:3') return '{:3' in windows

2020-08-18 Thread Eryk Sun
Eryk Sun added the comment: It's worth mentioning that pathlib restricts the first character of a Windows drive name to the set of ASCII letters in pathlib._WindowsFlavour.drive_letters. For example: >>> Path('3') / 'C:3' WindowsPath('C:3') vs. >>> Path('3') / '{:3'

[issue41565] from os.path import join join('3', '{:3') return '{:3' in windows

2020-08-18 Thread Paul Moore
Paul Moore added the comment: I think the key point here is that os.path.join is *meant* to have platform-native semantics, so it treats '{:' as a drive letter on Windows, but Linux doesn't have drive letters, so os.path.join treats '{:' as a normal part of a filename on Linux. --

[issue41565] from os.path import join join('3', '{:3') return '{:3' in windows

2020-08-18 Thread Eryk Sun
Eryk Sun added the comment: > I mean,os.path.join('3', '{:3') return '{:3' in windows, However, > os.path.join('3', '{:3') return '3/{:3'in linux, output result not > '3' in windows, why? The implementation of ntpath.join handles "{:" as a drive. Thus "{:3" is a drive-relative path, i.e.

[issue41565] from os.path import join join('3', '{:3') return '{:3' in windows

2020-08-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Because '{' in '{:3' is a drive letter. When you open file with path '{:3' you open file with name '3' in the current directory of drive '{', not file with name '{:3' on current drive and directory. It is not a Python bug. If you think there is a bug,

[issue41565] from os.path import join join('3', '{:3') return '{:3' in windows

2020-08-17 Thread song super
song super <2262720...@qq.com> added the comment: I mean,os.path.join('3', '{:3') return '{:3' in windows,However,os.path.join('3', '{:3') return '3/{:3'in linux,output result not '3'in windows,why? for example: >>> from os.path import join >>> join('3', '{:3') output:'{:3' >>> join('3',

[issue41565] from os.path import join join('3', '{:3') return '{:3' in windows

2020-08-17 Thread Eryk Sun
Eryk Sun added the comment: > I'm not sure if "}" could ever be valid drive letter The Windows file API is designed in a way to support almost any Unicode BMP character in a DOS drive designation. For example, the following creates "{:" as a substitute drive for "C:\\Temp": >>>

[issue41565] from os.path import join join('3', '{:3') return '{:3' in windows

2020-08-17 Thread Ronald Oussoren
Ronald Oussoren added the comment: I'm fairly sure this is intended behaviour, see . The second arguments is "{:3", the colon means this is interpreted as the the relative path "3" on drive "}:". I'm not sure if "}" could ever

[issue41565] from os.path import join join('3', '{:3') return '{:3' in windows

2020-08-16 Thread song super
New submission from song super <2262720...@qq.com>: python3.6 from os.path import join join('3', '{:3') return '{:3' in windows,However,join('3', '{:3') return '3//{:3' in linux,I think this is a bug -- components: Windows files: python bug.zip hgrepos: 391 messages: 375524