cdown / srt

A simple library and set of tools for parsing, modifying, and composing SRT files.
MIT License
473 stars 44 forks source link

[python3.8] Cannot install srt as dependency: SandboxViolation when using EasyInstall #65

Closed mrudelle closed 3 years ago

mrudelle commented 4 years ago

I am trying to install a package that depends on srt in a virtual environment and it seems that srt's is trying to create directories outside of the virtualenv, which EasyInstall doesn't like and prevent me from installing my package.

Note: I'm installing my package via setuptool (python setup.py install) under python3.8 Note: under python3.7 virtualenv there's no problem

Processing dependencies for XXXXXXXXXX==X.X.X
Searching for srt==3.4.1
Reading https://pypi.org/simple/srt/
Downloading https://files.pythonhosted.org/packages/3b/dd/0629a23b11da7696ce69e4432a2de6a1d1277bf2ba5cda624009069d4bb3/srt-3.4.1.tar.gz#sha256=aa507439bf593adb1b207d21c5975c9774263da97489f8b90d8a016bfa67ee94
Best match: srt 3.4.1
Processing srt-3.4.1.tar.gz
Writing /var/folders/8f/5grw13193792trmjfvznh_1c0000gn/T/easy_install-exgn49b9/srt-3.4.1/setup.cfg
Running srt-3.4.1/setup.py -q bdist_egg --dist-dir /var/folders/8f/5grw13193792trmjfvznh_1c0000gn/T/easy_install-exgn49b9/srt-3.4.1/egg-dist-tmp-dp_mr5x0
warning: no previously-included files matching '*.py[co]' found under directory '*'
warning: no previously-included files matching '__pycache__' found under directory '*'
error: Setup script exited with error: SandboxViolation: mkdir('/Users/XXXX/Library/Caches/com.apple.python/private', 511) {}

The package setup script has attempted to modify files on your system
that are not within the EasyInstall build area, and has been aborted.

This package cannot be safely installed by EasyInstall, and may not
support alternate installation locations even if you run its setup
script by hand.  Please inform the package's author and the EasyInstall
maintainers to find out if a fix or workaround is available.

Any idea what could be the source of this makedir? and if we can fix srt's installation procedure to support python 3.8?

cdown commented 4 years ago

Huh, we never try to write /Users/XXXX/Library/Caches/com.apple.python/private. I have no OSX machine to test though. What is in that cache folder?

For what it's worth, installation with pip is fine, and that's generally what we support. I'm happy to help you debug and fix this, but realistically I'm going to need more information since we don't try to mkdir there.

% python --version
Python 3.8.2
% pip install -U srt==3.4.1
Collecting srt==3.4.1
  Using cached srt-3.4.1.tar.gz (23 kB)
Building wheels for collected packages: srt
  Building wheel for srt (setup.py) ... done
  Created wheel for srt: filename=srt-3.4.1-py3-none-any.whl size=20571 sha256=856a511930fb7a8e7fcbb2e88ad6ca24d32445a5208fb7d0452bce6d32c9d3e4
  Stored in directory: /home/cdown/.cache/pip/wheels/9f/af/dd/53587b9034bb8d16f2e2f20b7b07ce4b2a39cea01c5fe263f3
Successfully built srt
Installing collected packages: srt
Successfully installed srt-3.4.1
mrudelle commented 4 years ago

Thanks for the quick reply, here's what folder was installed in this folder when running pip install: /Users/XXXX/Library/Caches/com.apple.python/private/var/folders/8f/5grw13193792trmjfvznh_1c0000gn/T/pip-install-paxmhrec Looks to me like a temp directory that was prefixed with /Users/XXXX/Library/Caches/com.apple.python/private The folder contains all packages required by our package (except srt) and quite a few others.

$ python --version      
Python 3.8.2
$ pip --version
pip 19.2.3
cdown commented 4 years ago

This doesn't sound like something srt-specific -- we don't do anything special there. Maybe it's related to some feature we use, like scripts= in the setup function, but realistically I don't think I have enough information to know what's going on here.

Can you reproduce this in a more limited fashion, in a way I could either reproduce it locally on Linux or on Travis? :-)

cdown commented 3 years ago

I'm going to close this one, since there's been no response for a while.