paylogic / pip-accel

pip-accel: Accelerator for pip, the Python package manager
https://pypi.python.org/pypi/pip-accel
MIT License
308 stars 35 forks source link

Disabling S3CacheBackend because it failed #68

Closed davidvasandani closed 2 years ago

davidvasandani commented 8 years ago

Testing pip-accel and running into this error. There is a config file for both boto and pip-accel.

2016-02-24 17:22:04 ad60d292765e pip_accel.caches[8287] ERROR Disabling S3CacheBackend because it failed: 'module' object has no attribute 'get'
Traceback (most recent call last):
  File "/opt/wp/app/helios/virtualenv/local/lib/python2.7/site-packages/pip_accel/caches/__init__.py", line 192, in put
    backend.put(filename, handle)
  File "/opt/wp/app/helios/virtualenv/local/lib/python2.7/site-packages/pip_accel/caches/s3.py", line 190, in put
    with PatchedBotoConfig():
  File "/opt/wp/app/helios/virtualenv/local/lib/python2.7/site-packages/pip_accel/caches/s3.py", line 359, in __init__
    self.unbound_method = ConfigParser.get
AttributeError: 'module' object has no attribute 'get'
xolox commented 8 years ago

Hi David and thanks for the feedback!

I've been trying for quite a while now but I can't figure out how to reproduce this (rather obscure) issue. The error message also just doesn't make any sense to me, because:

  1. pip_accel.caches.s3.PatchedBotoConfig.__init__() imports ConfigParser from the boto.pyami.config module.
  2. The boto.pyami.config module imports ConfigParser from the boto.compat module.
  3. The boto.compat module imports ConfigParser (on Python 2.x) as follows:
from ConfigParser import SafeConfigParser as ConfigParser

Given the above I don't see how the ConfigParser object in step one can ever be a module instead of a class (as implied by the error message 'module' object has no attribute 'get'). The only thing I can think of is some obscure interaction between top level modules that shadow each other, but then I suspect that most of your virtual environment would be broken ...

Now I could add a lot of logging and we could play ping pong in this issue tracker for a while to get to the bottom of this issue, however all of this concerns a workaround for the fact that Boto is kind of broken on Python 3.x and you seem to be running Python 2.7, so the pragmatic step seems to be to just disable the workaround on Python 2.x because it shouldn't be necessary anyway.

I'm preparing a change set that conditionally enables the workaround (only for Python 3.x). I'll push it to GitHub first to see if Travis CI agrees that I didn't introduce any new issues. If that works out I'll publish the new version to PyPI so you can easily try it out to confirm whether it resolves your issue.

xolox commented 8 years ago

It looks like Travis CI agrees that I didn't break anything :-) so I just published pip-accel 0.42.5 to PyPI. Can you try out the latest version and confirm whether it fixes the issue you reported?