[issue19456] ntpath doesn't join paths correctly when a drive is present

2014-01-27 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +brian.curtin, tim.golden ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19456 ___ ___

[issue19456] ntpath doesn't join paths correctly when a drive is present

2014-01-27 Thread R. David Murray
R. David Murray added the comment: I think a python programmer is going to expect that join(a, b, c) == join(join(a, b), c) so the answer to Serhiy's example should be 'c:z'. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org

[issue19456] ntpath doesn't join paths correctly when a drive is present

2014-01-27 Thread Brian Curtin
Changes by Brian Curtin br...@python.org: -- nosy: +zach.ware -brian.curtin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19456 ___ ___

[issue19456] ntpath doesn't join paths correctly when a drive is present

2014-01-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6b314f5c9404 by Serhiy Storchaka in branch '2.7': Issue #19456: ntpath.join() now joins relative paths correctly when a drive http://hg.python.org/cpython/rev/6b314f5c9404 New changeset f4377699fd47 by Serhiy Storchaka in branch '3.3': Issue

[issue19456] ntpath doesn't join paths correctly when a drive is present

2014-01-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Committed first patch (with small change, ntpath.join('c:', 'C:') now returns 'C:'). There is yet one argument for first option: it is almost impossible (with current design) to implement second option in pathlib. -- resolution: - fixed stage:

[issue19456] ntpath doesn't join paths correctly when a drive is present

2014-01-27 Thread Berker Peksag
Berker Peksag added the comment: Hi Serhiy, there are commented-out lines in the 2.7 version of the patch. Are they intentionally there?: +#tester(ntpath.join('//computer/share', 'x/y'), '//computer/share\\x/y') +#tester(ntpath.join('//computer/share/', 'x/y'),

[issue19456] ntpath doesn't join paths correctly when a drive is present

2014-01-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Merlijn for your information. So which patch is more preferable? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19456 ___

[issue19456] ntpath doesn't join paths correctly when a drive is present

2014-01-26 Thread Merlijn van Deen
Merlijn van Deen added the comment: I'm not sure whether that question was aimed at me -- I think both options have their merits, but I'd suggest to adopt the .NET semantics. The semantics are also explicitly defined [1] and the behavior seems to be acceptable for the .NET world. [1]

[issue19456] ntpath doesn't join paths correctly when a drive is present

2014-01-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I just discovered that perhaps ntpath.join should be even more clever. Windows supports current directories for every drive separately, so perhaps ntpath.join('c:/x', 'd:/y', 'c:z') should return 'c:/x\\z', not 'c:/z'. Could anyone please check it? Create

[issue19456] ntpath doesn't join paths correctly when a drive is present

2014-01-11 Thread Merlijn van Deen
Merlijn van Deen added the comment: so perhaps ntpath.join('c:/x', 'd:/y', 'c:z') should return 'c:/x\\z', not 'c:/z'. 'c:z' is consistent with what .NET's System.IO.Path.Combine does: via http://ironpython.net/try/ : import System.IO.Path; print System.IO.Path.Combine('c:/x', 'd:/y',

[issue19456] ntpath doesn't join paths correctly when a drive is present

2014-01-11 Thread Merlijn van Deen
Merlijn van Deen added the comment: Sorry, I was a bit too quick - I forgot to create c:\x\z. Now this is the result: c:\x\zcd c:/x c:\xcd e:/y c:\xcd c:z c:\x\z However, the behavior does not work in, for example, a 'Save as...' window, where c:z will always return illegal filename

[issue19456] ntpath doesn't join paths correctly when a drive is present

2014-01-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If there are no objections, I'll commit this patch tomorrow. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19456 ___

[issue19456] ntpath doesn't join paths correctly when a drive is present

2013-12-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: With previous patch: ntpath.join('C:a/b', 'D:y/z') 'D:y/z\\y/z' Should be 'D:y/z'. Here is other patch which implements same algorithm as in pathlib (issue19908). Added new tests, removed duplicated tests. -- assignee: - serhiy.storchaka nosy:

[issue19456] ntpath doesn't join paths correctly when a drive is present

2013-12-06 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: Added file: http://bugs.python.org/file33008/ntpath_join.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19456 ___

[issue19456] ntpath doesn't join paths correctly when a drive is present

2013-11-03 Thread Andrei Dorian Duma
Changes by Andrei Dorian Duma andrei.duma.dor...@gmail.com: -- nosy: +andrei.duma ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19456 ___ ___

[issue19456] ntpath doesn't join paths correctly when a drive is present

2013-11-03 Thread Guido van Rossum
Guido van Rossum added the comment: Looking at this some more, I think one of the reasons is that isabs() does not consider paths consisting of *just* a drive (either c: or \\host\share) to be absolute, but it considers a path without a drive but starting with a \ as absolute. So perhaps it's

[issue19456] ntpath doesn't join paths correctly when a drive is present

2013-11-03 Thread Andrei Dorian Duma
Andrei Dorian Duma added the comment: I'm willing to fix this. ntpath.join behaves weird in other situations too: ntpath.join('C:/a/b', 'D:x/y') 'C:/a/b\\D:x/y' In fact, I don't know what the above should return. -- ___ Python tracker

[issue19456] ntpath doesn't join paths correctly when a drive is present

2013-11-03 Thread Guido van Rossum
Guido van Rossum added the comment: PEP 428 offers a reasonable view. Search http://www.python.org/dev/peps/pep-0428/ for anchored and read on. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19456

[issue19456] ntpath doesn't join paths correctly when a drive is present

2013-11-03 Thread Andrei Dorian Duma
Andrei Dorian Duma added the comment: Added a possible fix for ntpath.join. Didn't touch isabs yet. -- keywords: +patch Added file: http://bugs.python.org/file32486/fix_ntpath_join.patch ___ Python tracker rep...@bugs.python.org

[issue19456] ntpath doesn't join paths correctly when a drive is present

2013-11-03 Thread Bruce Leban
Bruce Leban added the comment: A non-UNC windows path consists of two parts: a drive and a conventional path. If the drive is left out, it's relative to the current drive. If the path part does not have a leading \ then it's relative to the current path on that drive. Note that Windows has a

[issue19456] ntpath doesn't join paths correctly when a drive is present

2013-11-03 Thread Guido van Rossum
Guido van Rossum added the comment: Do we even have a way to get the current directory for a given drive? (I guess this is only needed for C: style drives.) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19456

[issue19456] ntpath doesn't join paths correctly when a drive is present

2013-11-01 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19456 ___ ___ Python-bugs-list

[issue19456] ntpath doesn't join paths correctly when a drive is present

2013-10-30 Thread Guido van Rossum
New submission from Guido van Rossum: (Bruce Leban, on python-ideas:) ntpath still gets drive-relative paths wrong on Windows: ntpath.join(r'\\a\b\c\d', r'\e\f') '\\e\\f' # should be r'\\a\b\e\f' ntpath.join(r'C:\a\b\c\d', r'\e\f') '\\e\\f' # should be r'C:\e\f' (same behavior in Python