When replacing a symlink object with a file object, enstaller will fail with 'Permission Denied' if the link target is in the system Canopy installation. This change checks if the target for a file write is a symlink and unlinks it if necessary.
EDIT: For clarity, this problem happened for a fresh install of Canopy 1.5.2 when a user attempted to install the zeromq package. By default, the file $CANOPY_PATH/bin/curve_keygen is a symlink to the system version of curve_keygen at "/appdata/canopy-1.5.1.2730.rh5-x86_64/bin/curve_keygen". When a user attempts to install zeromq with enpkg, they receive this error:
[...]
File "/mnt/data/localadmin/pkgs/enthought/canopy-1.5.2/lib/python2.7/site-packages/egginst/_zipfile.py", line 97, in _extract_member_to
with open(targetpath, "wb") as target:
IOError: [Errno 13] Permission denied: '/mnt/data/localadmin/pkgs/enthought/canopy-1.5.2/bin/curve_keygen'
_extract_member_to is trying to open the the symlink target (in /opt) instead of removing the symlink and creating a local copy.
When replacing a symlink object with a file object, enstaller will fail with 'Permission Denied' if the link target is in the system Canopy installation. This change checks if the target for a file write is a symlink and unlinks it if necessary.
EDIT: For clarity, this problem happened for a fresh install of Canopy 1.5.2 when a user attempted to install the zeromq package. By default, the file $CANOPY_PATH/bin/curve_keygen is a symlink to the system version of curve_keygen at "/appdata/canopy-1.5.1.2730.rh5-x86_64/bin/curve_keygen". When a user attempts to install zeromq with enpkg, they receive this error:
[...] File "/mnt/data/localadmin/pkgs/enthought/canopy-1.5.2/lib/python2.7/site-packages/egginst/_zipfile.py", line 97, in _extract_member_to with open(targetpath, "wb") as target: IOError: [Errno 13] Permission denied: '/mnt/data/localadmin/pkgs/enthought/canopy-1.5.2/bin/curve_keygen'
_extract_member_to is trying to open the the symlink target (in /opt) instead of removing the symlink and creating a local copy.