rspivak / slimit

SlimIt - a JavaScript minifier/parser in Python
MIT License
550 stars 94 forks source link

minify fails with ply 3.6 #76

Closed tomgross closed 8 years ago

tomgross commented 9 years ago

minify fails with the following error when using with ply 3.6 (released on 2015-04-26):

  ...
  File "/home/vagrant/Eggs/slimit-0.8.1-py2.7.egg/slimit/minifier.py", line 37, in minify
    parser = Parser()
  File "/home/vagrant/Eggs/slimit-0.8.1-py2.7.egg/slimit/parser.py", line 56, in __init__
    self.lexer.build(optimize=lex_optimize, lextab=lextab)
  File "/home/vagrant/Eggs/slimit-0.8.1-py2.7.egg/slimit/lexer.py", line 102, in build
    self.lexer = ply.lex.lex(object=self, **kwargs)
  File "/home/vagrant/Eggs/ply-3.6-py2.7.egg/ply/lex.py", line 893, in lex
    if '.' not in lextab:
TypeError: argument of type 'module' is not iterable
hannseman commented 9 years ago

Same problem here.

rmfitzpatrick commented 9 years ago

+1

rmfitzpatrick commented 9 years ago

Opened ply 3.6 issue since lex.py seems to have the bug.

byyo commented 9 years ago

+1

cmdelatorre commented 9 years ago

+1 (it works with ply==3.4)

dmoisset commented 9 years ago

Same here, going to 3.4 did the trick. I also made it work with 3.6 forcing the lextab and yacctab arguments to be strings instead of passing the module.

The problem is easy to reproduce by doing:

from slimit.parser import Parser
Parser()
w00k4sh commented 9 years ago

+1

shemigon commented 9 years ago

Same to me: downgrading ply to 3.4 and it works well.

kzahel commented 9 years ago

+1 downgraded to 3.4

ghost commented 9 years ago

Same problem here: downgraded ply to 3.4 and it works well.

nicolls1 commented 9 years ago

+1 downgraded to ply 3.4

hellskitchendev commented 9 years ago

+1 had to downgrade to ply 3.4 to get things working. Was having issues while running compress using django-compress

erazor83 commented 9 years ago

+1 downgraded to 3.4

xmcp commented 8 years ago

+1

karyon commented 8 years ago

fyi, this is fixed in ply 3.8, which is now on pypi, see https://pypi.python.org/pypi/ply.

tomgross commented 8 years ago

Works with ply 3.9