[issue28627] [alpine] shutil.copytree fail to copy a direcotry with broken symlinks

2019-02-10 Thread Benjamin Peterson


Change by Benjamin Peterson :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue28627] [alpine] shutil.copytree fail to copy a direcotry with broken symlinks

2018-04-20 Thread Martin Panter

Martin Panter  added the comment:

This looks like it may be covered by Issue 31940, about the “shutil.copystat” 
API. See Anthony’s initial proposal at 
.

Max: I think you need the “else” branch to reraise the exception if “errno” 
doesn’t match. Perhaps a test case would have picked this up.

--
nosy: +martin.panter
superseder:  -> copystat on symlinks fails for alpine -- faulty lchmod 
implementation?

___
Python tracker 

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



[issue28627] [alpine] shutil.copytree fail to copy a direcotry with broken symlinks

2018-04-18 Thread Max Rees

Max Rees  added the comment:

Actually the symlinks don't need to be broken. It fails for any kind of symlink
on musl.

$ ls -l /tmp/symtest
lrwxrwxrwx 1 mcrees mcrees 10 Apr 18 21:16 empty -> /var/empty
-rw-r--r-- 1 mcrees mcrees  0 Apr 18 21:16 regular
lrwxrwxrwx 1 mcrees mcrees 16 Apr 18 21:16 resolv.conf -> /etc/resolv.conf

$ python3
>>> import shutil; shutil.copytree('/tmp/symtest', '/tmp/symtest2', 
>>> symlinks=True)
shutil.Error: [('/tmp/symtest/resolv.conf', '/tmp/symtest2/resolv.conf', "[Errno
95] Not supported: '/tmp/symtest2/resolv.conf'"), ('/tmp/symtest/empty',
'/tmp/symtest2/empty', "[Errno 95] Not supported: '/tmp/symtest2/empty'")]

$ ls -l /tmp/symtest2
total 0
lrwxrwxrwx 1 mcrees mcrees 10 Apr 18 21:16 empty -> /var/empty
-rw-r--r-- 1 mcrees mcrees  0 Apr 18 21:16 regular
lrwxrwxrwx 1 mcrees mcrees 16 Apr 18 21:16 resolv.conf -> /etc/resolv.conf

The implication of these bugs mean that things like pip may fail if it calls
shutil.copytree(..., symlinks=True) on a directory that contains symlinks(!)

Attached is a patch that works around the issue but does not address why chmod
is returning OSError instead of NotImplementedError.

--
keywords: +patch
nosy: +sroracle
Added file: https://bugs.python.org/file47540/musl-eopnotsupp.patch

___
Python tracker 

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



[issue28627] [alpine] shutil.copytree fail to copy a direcotry with broken symlinks

2016-11-06 Thread Israel Fruchter

Israel Fruchter added the comment:

the failure looks like that:

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python3.5/shutil.py", line 359, in copytree
raise Error(errors)
shutil.Error: [('/bug/broken', '/temp/broken', "[Errno 95] Not supported: 
'/temp/broken'")]

--

___
Python tracker 

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



[issue28627] [alpine] shutil.copytree fail to copy a direcotry with broken symlinks

2016-11-06 Thread Israel Fruchter

New submission from Israel Fruchter:

this fails on python3.5-alpine and python3.6-alpine
(works as fine in python2.7-alpine)

cd /bug && ln -s /broken_path/to_nowhere broken
python -c "import shutil; shutil.copytree('/bug', '/temp', symlinks=True)"

Dockerfile example here:
https://github.com/docker-library/python/issues/155

https://github.com/python/cpython/blob/c30098c8c6014f3340a369a31df9c74bdbacc269/Lib/shutil.py#L198

seem like its suppressing NotImplementedError, and in our case OsError with 
ENOSUP was raised

--
components: Library (Lib)
messages: 280178
nosy: fruch
priority: normal
severity: normal
status: open
title: [alpine] shutil.copytree fail to copy a direcotry with broken symlinks
type: behavior
versions: Python 3.5, Python 3.6

___
Python tracker 

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