[issue19887] Path.resolve() ENAMETOOLONG on pathologic symlinks

2013-12-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: How the test can be simpler? It is already simple. You ca use pathlib_resolve_test.py but replace `os.symlink('.', 'testdir/0')` by `os.symlink(os.path.abspath('testdir'), 'testdir/0')`. Or use following shell commands: mkdir testdir for i in $(seq 100); do

[issue19887] Path.resolve() ENAMETOOLONG on pathologic symlinks

2013-12-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: I would prefer if you made the test simpler. The current setup makes it difficult to understand and reproduce with the command line. -- ___ Python tracker

[issue19887] Path.resolve() ENAMETOOLONG on pathologic symlinks

2013-12-05 Thread Vajrasky Kok
Vajrasky Kok added the comment: It works. Just a coding nitpick, instead of hardcoding os.symlink(src, dst, target_is_directory=True) in the test, you can use helper function in the test itself, self.dirlink. -- ___ Python tracker

[issue19887] Path.resolve() ENAMETOOLONG on pathologic symlinks

2013-12-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Vajrasky. Here is a patch with fixed tests. -- Added file: http://bugs.python.org/file32990/pathlib_resolve_2.patch ___ Python tracker _

[issue19887] Path.resolve() ENAMETOOLONG on pathologic symlinks

2013-12-05 Thread Vajrasky Kok
Vajrasky Kok added the comment: Whoa, Serhiy, your patch won't fly on Windows Vista. For starter, the patch does not use target_is_directory=True option in os.symlink. It needs that option when creating symlink to the directory on Windows Vista. The maximum depth that pathlib can do on Window

[issue19887] Path.resolve() ENAMETOOLONG on pathologic symlinks

2013-12-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Path.resolve() also fails when last link is absolute. mkdir testdir ln -s 0/0 testdir/1 ln -s 1/1 testdir/2 ln -s "$(readlink -f testdir)" testdir/0 Path('testdir/2').resolve() fails: Traceback (most recent call last): File "", line 1, in File "/home/se

[issue19887] Path.resolve() ENAMETOOLONG on pathologic symlinks

2013-12-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: This is https://bitbucket.org/pitrou/pathlib/issue/9/pathresolve-fails-on-complex-symlinks As noted there: """It's a ENAMETOOLONG error when calling readlink(), because there are many "." components. This is really an edge case caused by the specific test set