faassen / bowerstatic

Serve Bower-managed static resources using WSGI
BSD 3-Clause "New" or "Revised" License
49 stars 17 forks source link

Python 3 compatibility still needs work #48

Closed sloat closed 9 years ago

sloat commented 9 years ago

Got the following error trying out BowerStatic with Python 3.4.2:

Traceback (most recent call last):
File "run.py", line 1, in <module>
    from app import app
File "/Users/matt/py-stuff/someproject/app/__init__.py", line 60, in <module>
    bower = bowerstatic.Bower()
File "/Users/matt/venvs/someproject/lib/python3.4/site-packages/bowerstatic/core.py", line 18, in __init__
    self._renderer = Renderer()
File "/Users/matt/venvs/someproject/lib/python3.4/site-packages/bowerstatic/renderer.py", line 8, in __init__
    self.register('.js', render_js)
File "/Users/matt/venvs/someproject/lib/python3.4/site-packages/bowerstatic/renderer.py", line 16, in register
    self._renderers[ext] = make_renderer(renderer)
File "/Users/matt/venvs/someproject/lib/python3.4/site-packages/bowerstatic/renderer.py", line 35, in make_renderer
    if isinstance(renderer, basestring):
NameError: name 'basestring' is not defined

It can be worked-around for the time being by monkey-patching renderer.py:

import bowerstatic
bowerstatic.renderer.basestring = str
faassen commented 9 years ago

My bad, forgot to run tox again before release...

faassen commented 9 years ago

Thanks for reporting this! I just released a 0.8.1 that should fix the Python 3 issue.