[issue19887] Path.resolve() fails on complex symlinks

2014-01-10 Thread Philippe Fremy

Philippe Fremy added the comment:

Hi,

This precise set of tests fails on Windows 7 on a NTFS partition (on revision  
c0b0e7aef360+ tip ), see below.

The problem  is probably minor (drive letter case). I won't be able to develop 
a fix myself, but I'll be happy to test one.

cheers,

Philippe

==
FAIL: test_complex_symlinks_absolute (test.test_pathlib.PathTest)
--
Traceback (most recent call last):
  File 
"c:\Users\Morgane\Documents\000\Dev\CPython\cpython\lib\test\test_pathlib.py", 
line 1724, in test_complex_symlinks_absolute
self._check_complex_symlinks(BASE)
  File 
"c:\Users\Morgane\Documents\000\Dev\CPython\cpython\lib\test\test_pathlib.py", 
line 1692, in _check_complex_symlinks
self.assertEqual(str(p), BASE)
AssertionError: 'C:\\Users\\Morgane\\Documents\\000\\Dev\\[53 chars]_tmp' != 
'c:\\Users\\Morgane\\Documents\\000\\Dev\\[53 chars]_tmp'
- 
C:\Users\Morgane\Documents\000\Dev\CPython\cpython\build\test_python_6060\@test_6060_tmp
? ^
+ 
c:\Users\Morgane\Documents\000\Dev\CPython\cpython\build\test_python_6060\@test_6060_tmp
? ^


==
FAIL: test_complex_symlinks_relative (test.test_pathlib.PathTest)
--
Traceback (most recent call last):
  File 
"c:\Users\Morgane\Documents\000\Dev\CPython\cpython\lib\test\test_pathlib.py", 
line 1728, in test_complex_symlinks_relative
self._check_complex_symlinks('.')
  File 
"c:\Users\Morgane\Documents\000\Dev\CPython\cpython\lib\test\test_pathlib.py", 
line 1692, in _check_complex_symlinks
self.assertEqual(str(p), BASE)
AssertionError: 'C:\\Users\\Morgane\\Documents\\000\\Dev\\[53 chars]_tmp' != 
'c:\\Users\\Morgane\\Documents\\000\\Dev\\[53 chars]_tmp'
- 
C:\Users\Morgane\Documents\000\Dev\CPython\cpython\build\test_python_6060\@test_6060_tmp
? ^
+ 
c:\Users\Morgane\Documents\000\Dev\CPython\cpython\build\test_python_6060\@test_6060_tmp
? ^


==
FAIL: test_complex_symlinks_relative_dot_dot (test.test_pathlib.PathTest)
--
Traceback (most recent call last):
  File 
"c:\Users\Morgane\Documents\000\Dev\CPython\cpython\lib\test\test_pathlib.py", 
line 1732, in test_complex_symlinks_relative_dot_dot
self._check_complex_symlinks(os.path.join('dirA', '..'))
  File 
"c:\Users\Morgane\Documents\000\Dev\CPython\cpython\lib\test\test_pathlib.py", 
line 1692, in _check_complex_symlinks
self.assertEqual(str(p), BASE)
AssertionError: 'C:\\Users\\Morgane\\Documents\\000\\Dev\\[53 chars]_tmp' != 
'c:\\Users\\Morgane\\Documents\\000\\Dev\\[53 chars]_tmp'
- 
C:\Users\Morgane\Documents\000\Dev\CPython\cpython\build\test_python_6060\@test_6060_tmp
? ^
+ 
c:\Users\Morgane\Documents\000\Dev\CPython\cpython\build\test_python_6060\@test_6060_tmp
? ^


==
FAIL: test_complex_symlinks_absolute (test.test_pathlib.WindowsPathTest)
--
Traceback (most recent call last):
  File 
"c:\Users\Morgane\Documents\000\Dev\CPython\cpython\lib\test\test_pathlib.py", 
line 1724, in test_complex_symlinks_absolute
self._check_complex_symlinks(BASE)
  File 
"c:\Users\Morgane\Documents\000\Dev\CPython\cpython\lib\test\test_pathlib.py", 
line 1692, in _check_complex_symlinks
self.assertEqual(str(p), BASE)
AssertionError: 'C:\\Users\\Morgane\\Documents\\000\\Dev\\[53 chars]_tmp' != 
'c:\\Users\\Morgane\\Documents\\000\\Dev\\[53 chars]_tmp'
- 
C:\Users\Morgane\Documents\000\Dev\CPython\cpython\build\test_python_6060\@test_6060_tmp
? ^
+ 
c:\Users\Morgane\Documents\000\Dev\CPython\cpython\build\test_python_6060\@test_6060_tmp
? ^


==
FAIL: test_complex_symlinks_relative (test.test_pathlib.WindowsPathTest)
--
Traceback (most recent call last):
  File 
"c:\Users\Morgane\Documents\000\Dev\CPython\cpython\lib\test\test_pathlib.py", 
line 1728, in test_complex_symlinks_relative
self._check_complex_symlinks('.')
  File 
"c:\Users\Morgane\Documents\000\Dev\CPython\cpython\lib\test\test_pathlib.py", 
line 1692, in _check_complex_symlinks
self.assertEqual(str(p), BASE)
AssertionError: 'C:\\Users\\Morgane\\Documents\\000\\Dev\\[53 chars]_tmp' != 
'c:\\Users\\Morgane\\Documents\\000\\Dev\\[53 chars]_tmp'
- 
C:\Users\Morgane\Documents\000\Dev\CPython\cpython\build\test_python_6060\@test_6060_tmp
? ^
+ 
c:\Users\Morgane\Documents\000\Dev\CPython\cpython\build\test_python_6060\@test_6060_tmp
? ^


==
FAIL: test_complex_symlinks_relative_dot_dot (tes

[issue19887] Path.resolve() fails on complex symlinks

2013-12-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Thanks a lot for the patch!

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19887] Path.resolve() fails on complex symlinks

2013-12-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 12a52186b4fd by Antoine Pitrou in branch 'default':
Issue #19887: Improve the Path.resolve() algorithm to support certain symlink 
chains.
http://hg.python.org/cpython/rev/12a52186b4fd

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19887] Path.resolve() fails on complex symlinks

2013-12-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ah, I remember. Using subtests would make it more annoying to backport to 2.7.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19887] Path.resolve() fails on complex symlinks

2013-12-16 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> why you repeat similar code 3-4 times instead using loops?

For no real reason :) I'll try with a loop.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19887] Path.resolve() fails on complex symlinks

2013-12-16 Thread Vajrasky Kok

Vajrasky Kok added the comment:

The patch passed on Windows Vista.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19887] Path.resolve() fails on complex symlinks

2013-12-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> I suppose that was some kind of joke, but what I meant was that we don't need 
> to test with 100 levels of symlinks. 2 or 3 are enough...

Yes, sorry for this joke. Your tests LGTM, but why you repeat similar code 3-4 
times instead using loops?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19887] Path.resolve() fails on complex symlinks

2013-12-15 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Here is a patch with refactored tests. Vajrasky, do you want to test under 
Windows?

--
Added file: http://bugs.python.org/file33156/pathlib_resolve_4.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19887] Path.resolve() fails on complex symlinks

2013-12-15 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Here is a patch with unrolled loops.

I suppose that was some kind of joke, but what I meant was that we don't need 
to test with 100 levels of symlinks. 2 or 3 are enough...

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19887] Path.resolve() fails on complex symlinks

2013-12-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> pitrou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19887] Path.resolve() fails on complex symlinks

2013-12-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch with unrolled loops.

--
Added file: http://bugs.python.org/file33024/pathlib_resolve_3.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19887] Path.resolve() fails on complex symlinks

2013-12-07 Thread Vajrasky Kok

Vajrasky Kok added the comment:

And don't forget to use self.dirlink instead of os.symlink(src, dst, 
target_is_directory=True).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19887] Path.resolve() fails on complex symlinks

2013-12-07 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> How the test can be simpler? It is already simple.

I mean, don't use loops but a simple test setup as in test_resolve_dot.
I am not interested in the pathologic "100 symlinks" case, just the case where 
the symlink is absolute.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19887] Path.resolve() fails on complex symlinks

2013-12-07 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
title: Path.resolve() ENAMETOOLONG on pathologic symlinks -> Path.resolve() 
fails on complex symlinks

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com