我们正在使用追踪。在我们的设置中,我们有一个在存储库中解决的问题。因此,我从存储库中获得了固定文件commit_update.py,我需要将其放入Trac-0.12-py2.6.egg中。

由于egg只是一个压缩文件,因此我将其解压缩,更改文件并再次压缩。重新启动trac后,我收到一条错误消息:

ExtractionError: Can't extract file(s) to egg cache

The following error occurred while trying to extract file(s) to the Python egg
cache:

    [Errno 20] Not a directory

The Python egg cache directory is currently set to:

    /var/trac/plugin-cache

Perhaps your account does not have write access to this directory?  You can
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to an accessible directory.

我不太明白为什么会出现此错误,因为我在www-data下运行trac实例,并且它是插件缓存的所有者。

将不胜感激任何想法。

最佳答案

只需构建一个新的egg(使用python setup.py bdist_egg),重新安装egg并重新启动您的trac实例即可。

关于python - 如何在python egg中更新文件,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/3736043/

10-12 22:18