Bug 1242929 - python-slimit: doesn't work with python 3
Summary: python-slimit: doesn't work with python 3
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-ply
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Stephen Gallagher
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1238559
TreeView+ depends on / blocked
 
Reported: 2015-07-14 12:38 UTC by Michael Simacek
Modified: 2015-09-04 03:24 UTC (History)
2 users (show)

Fixed In Version: 3.6-2.fc23
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-09-04 03:24:53 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Michael Simacek 2015-07-14 12:38:34 UTC
Description of problem:
python-slimit recently switched to using python 3 for the main executable /usr/bin/slimit. But it doesn't seem to work with python 3 yet, so it should either fix the incompatibility or switch back to python 2 until the incompatibility is fixed.

Version-Release number of selected component (if applicable):
python3-slimit-0.8.1-1.fc23.noarch

How reproducible:
always

Steps to Reproduce:
1. slimit --mangle < foo.js > foo-min.js

Actual results:
Traceback (most recent call last):
  File "/usr/bin/slimit", line 9, in <module>
    load_entry_point('slimit==0.8.1', 'console_scripts', 'slimit')()
  File "/usr/lib/python3.4/site-packages/slimit/minifier.py", line 69, in main
    text, mangle=options.mangle, mangle_toplevel=options.mangle_toplevel)
  File "/usr/lib/python3.4/site-packages/slimit/minifier.py", line 38, in minify
    tree = parser.parse(text)
  File "/usr/lib/python3.4/site-packages/slimit/parser.py", line 93, in parse
    return self.parser.parse(text, lexer=self.lexer, debug=debug)
  File "/usr/lib/python3.4/site-packages/ply/yacc.py", line 265, in parse
    return self.parseopt_notrack(input,lexer,debug,tracking,tokenfunc)
  File "/usr/lib/python3.4/site-packages/ply/yacc.py", line 971, in parseopt_notrack
    p.callable(pslice)
  File "/usr/lib/python3.4/site-packages/slimit/parser.py", line 1101, in p_case_block
    p[0] = p[2:-1]
  File "/usr/lib/python3.4/site-packages/ply/yacc.py", line 198, in __getitem__
    if n >= 0: return self.slice[n].value
TypeError: unorderable types: slice() >= int()

Expected results:
No error

Comment 1 Jan Kurik 2015-07-15 13:16:59 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 23 development cycle.
Changing version to '23'.

(As we did not run this process for some time, it could affect also pre-Fedora 23 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 23 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora23

Comment 2 Stephen Gallagher 2015-08-18 11:28:32 UTC
It turns out that this is actually a bug in python-ply, not slimit: https://github.com/dabeaz/ply/issues/63

Comment 3 Fedora Update System 2015-08-18 11:42:51 UTC
python-ply-3.6-2.fc23 has been submitted as an update for Fedora 23.
https://admin.fedoraproject.org/updates/python-ply-3.6-2.fc23

Comment 4 Michael Simacek 2015-08-18 12:14:02 UTC
Now it works, but spits out a bunch of warnings:
WARNING: Couldn't write lextab module <module 'slimit.lextab' from '/usr/lib/python3.4/site-packages/slimit/lextab.py'>. Won't overwrite existing lextab module
WARNING: yacc table file version is out of date
WARNING: Token 'SUPER' defined, but not used
WARNING: Token 'IMPORT' defined, but not used
WARNING: Token 'ENUM' defined, but not used
WARNING: Token 'EXTENDS' defined, but not used
WARNING: Token 'LINE_COMMENT' defined, but not used
WARNING: Token 'CONST' defined, but not used
WARNING: Token 'BLOCK_COMMENT' defined, but not used
WARNING: Token 'LINE_TERMINATOR' defined, but not used
WARNING: Token 'EXPORT' defined, but not used
WARNING: Token 'CLASS' defined, but not used
WARNING: There are 10 unused tokens
WARNING: Couldn't create <module 'slimit.yacctab' from '/usr/lib/python3.4/site-packages/slimit/yacctab.py'>. Won't overwrite existing tabmodule

I don't know whether it can cause any real problems.

Comment 5 Stephen Gallagher 2015-08-18 12:19:30 UTC
(In reply to Michael Simacek from comment #4)
> Now it works, but spits out a bunch of warnings:
> WARNING: Couldn't write lextab module <module 'slimit.lextab' from
> '/usr/lib/python3.4/site-packages/slimit/lextab.py'>. Won't overwrite
> existing lextab module
> WARNING: yacc table file version is out of date
> WARNING: Token 'SUPER' defined, but not used
> WARNING: Token 'IMPORT' defined, but not used
> WARNING: Token 'ENUM' defined, but not used
> WARNING: Token 'EXTENDS' defined, but not used
> WARNING: Token 'LINE_COMMENT' defined, but not used
> WARNING: Token 'CONST' defined, but not used
> WARNING: Token 'BLOCK_COMMENT' defined, but not used
> WARNING: Token 'LINE_TERMINATOR' defined, but not used
> WARNING: Token 'EXPORT' defined, but not used
> WARNING: Token 'CLASS' defined, but not used
> WARNING: There are 10 unused tokens
> WARNING: Couldn't create <module 'slimit.yacctab' from
> '/usr/lib/python3.4/site-packages/slimit/yacctab.py'>. Won't overwrite
> existing tabmodule
> 
> I don't know whether it can cause any real problems.

Yes, I've seen the warnings but it appears to run to completion and produce sensible output, so I ran with it.

Comment 6 Fedora Update System 2015-08-19 08:03:37 UTC
Package python-ply-3.6-2.fc23:
* should fix your issue,
* was pushed to the Fedora 23 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing python-ply-3.6-2.fc23'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-13668/python-ply-3.6-2.fc23
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2015-09-04 03:24:51 UTC
python-ply-3.6-2.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.