[Twisted-Python] More trial problems with 8.0.1
Hi, Earlier today I posted about a problem with trial. I reinstalled 8.0.1 and the origianl problem has gone away. Now I get the following error. It appears that trial is trying to write something to the plugins directory. But that doesn't (and shouldn't) have the correct write permissions. I can run trial with as sudo, but not as a regular user. Isn't it bad practice to rely on being able to write to site-packages at runtime. Shouldn't such things do into a .twisted directory or something like that? Brian Here is what I get vpn14:~ bgranger$ trial ipython1 Traceback (most recent call last): File "/Library/Python/2.5/site-packages/Twisted-8.0.1-py2.5-macosx-10.5-i386.egg/twisted/python/usage.py", line 241, in parseOptions self.postOptions() File "/Library/Python/2.5/site-packages/Twisted-8.0.1-py2.5-macosx-10.5-i386.egg/twisted/scripts/trial.py", line 293, in postOptions self['reporter'] = self._loadReporterByName(self['reporter']) File "/Library/Python/2.5/site-packages/Twisted-8.0.1-py2.5-macosx-10.5-i386.egg/twisted/scripts/trial.py", line 279, in _loadReporterByName for p in plugin.getPlugins(itrial.IReporter): File "/Library/Python/2.5/site-packages/Twisted-8.0.1-py2.5-macosx-10.5-i386.egg/twisted/plugin.py", line 200, in getPlugins allDropins = getCache(package) --- <exception caught here> --- File "/Library/Python/2.5/site-packages/Twisted-8.0.1-py2.5-macosx-10.5-i386.egg/twisted/plugin.py", line 179, in getCache dropinPath.setContent(pickle.dumps(dropinDotCache)) File "/Library/Python/2.5/site-packages/Twisted-8.0.1-py2.5-macosx-10.5-i386.egg/twisted/python/filepath.py", line 540, in setContent sib.open('w').write(content) File "/Library/Python/2.5/site-packages/Twisted-8.0.1-py2.5-macosx-10.5-i386.egg/twisted/python/filepath.py", line 369, in open return open(self.path, mode+'b') exceptions.IOError: [Errno 13] Permission denied: '/Library/Python/2.5/site-packages/Twisted-8.0.1-py2.5-macosx-10.5-i386.egg/twisted/plugins/dropin.cache.new'
On Thu, 10 Apr 2008 14:44:45 -0600, Brian Granger <ellisonbg.net@gmail.com> wrote:
Hi,
Earlier today I posted about a problem with trial. I reinstalled 8.0.1 and the origianl problem has gone away. Now I get the following error. It appears that trial is trying to write something to the plugins directory. But that doesn't (and shouldn't) have the correct write permissions. I can run trial with as sudo, but not as a regular user. Isn't it bad practice to rely on being able to write to site-packages at runtime. Shouldn't such things do into a .twisted directory or something like that?
See the plugin cache section of the plugin howto documentation: http://twistedmatrix.com/projects/core/documentation/howto/plugin.html#auto3 Specifically, the paragraph about site-wide installations. Jean-Paul
On Thu, Apr 10, 2008 at 2:49 PM, Jean-Paul Calderone <exarkun@divmod.com> wrote:
On Thu, 10 Apr 2008 14:44:45 -0600, Brian Granger <ellisonbg.net@gmail.com> wrote:
Hi,
Earlier today I posted about a problem with trial. I reinstalled 8.0.1 and the origianl problem has gone away. Now I get the following error. It appears that trial is trying to write something to the plugins directory. But that doesn't (and shouldn't) have the correct write permissions. I can run trial with as sudo, but not as a regular user. Isn't it bad practice to rely on being able to write to site-packages at runtime. Shouldn't such things do into a .twisted directory or something like that?
See the plugin cache section of the plugin howto documentation:
http://twistedmatrix.com/projects/core/documentation/howto/plugin.html#auto3
Specifically, the paragraph about site-wide installations.
Jean-Paul
OK, there is documentation, but I still don't think it is a good idea to rely on write permissions in this way. Examples: 1) User downloads the Mac OS X installer for twisted from the twisted web site. They install it and run trial and get this nasty exception about write permissions. This installer installs into the system-wide sitepackages and user will basically _always_ get this problem. 2) User installed twisted by doing "sudo easy_install Twisted" They too get the exception anytime they run trial. 3) User installs using the tarball and installs using the standard "sudo python setup.py install." They get it too, unless they add an optional argument to have twisted installed in their home directory some place. The bottom line is that these installation routes are not exceptional, they are the most common ones. This approach almost ensures that almost all of our users will observe this exception when they run our (ipython1's) test suite. The same will be true of any twisted using project that relies on trial or (likely) the plugin architecture. This behavior may be documented, but I still think it is a bad idea. Am I misunderstanding something? Thanks, Brian
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
On 09:23 pm, ellisonbg.net@gmail.com wrote:
OK, there is documentation, but I still don't think it is a good idea to rely on write permissions in this way. Examples:
You're right, insofar as the person who should have read that documentation was the author of the installer, and not you. As a post- installation action, the installer should load plugins and thereby write all of the appropriate cache files. You're correct in saying that end-users should not have to deal with this edge-case. However, that doesn't mean that the right fix is to write the files somewhere else; the right fix is to have installers that finish installation.
OK, there is documentation, but I still don't think it is a good idea to rely on write permissions in this way. Examples:
You're right, insofar as the person who should have read that documentation was the author of the installer, and not you. As a post- installation action, the installer should load plugins and thereby write all of the appropriate cache files.
You're correct in saying that end-users should not have to deal with this edge-case. However, that doesn't mean that the right fix is to write the files somewhere else; the right fix is to have installers that finish installation.
Either way sounds good to me. Brian
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
participants (3)
-
Brian Granger -
glyph@divmod.com -
Jean-Paul Calderone