python2 works though looks like a couple of possible fixes though. https://github.com/asottile/cpython/commit/61095aa54e9e159a6e67da570615dc81d6bb2d6a https://github.com/asottile/cpython/commit/ad495d0b10255c488a1afc3eb12b0f49b19919fd and upstr Reproducible: Always Steps to Reproduce: # ls -l symlinks_in_here/ total 0 -rw-r--r-- 1 root root 0 Nov 16 05:41 real_file lrwxrwxrwx 1 root root 9 Nov 16 05:41 sym_file -> real_file # python3 Python 3.5.4 (default, Nov 1 2017, 02:35:39) [GCC 5.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import shutil >>> shutil.copytree('symlinks_in_here', '1', symlinks=True) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3.5/shutil.py", line 359, in copytree raise Error(errors) shutil.Error: [('symlinks_in_here/sym_file', '1/sym_file', "[Errno 95] Not supported: '1/sym_file'")]
still broken :( # python Python 3.6.5 (default, Oct 22 2018, 02:31:47) [GCC 7.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import shutil >>> shutil.copytree('symlinks_in_here', '1', symlinks=True) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3.6/shutil.py", line 359, in copytree raise Error(errors) shutil.Error: [('symlinks_in_here/sym_file', '1/sym_file', "[Errno 95] Not supported: '1/sym_file'")] >>> # ls -l symlinks_in_here/ total 0 -rw-r--r-- 1 root root 0 Jun 13 03:56 real_file lrwxrwxrwx 1 root root 9 Jun 13 03:56 sym_file -> real_file
as of py3.6.5
https://bugs.python.org/issue34652 looks like the updated bug, says solved, maybe a newer version of python is needed? confirmed FIXED in 3.6.8 and 3.7.3 and 2.7.16 BROKEN in 3.5.7 so, when stable it's fixed, but not stable yet