Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSBeautifier throws TypeError under Python 3.10.4 on Windows 10 #14

Open
skanga opened this issue Mar 31, 2022 · 0 comments
Open

JSBeautifier throws TypeError under Python 3.10.4 on Windows 10 #14

skanga opened this issue Mar 31, 2022 · 0 comments

Comments

@skanga
Copy link

skanga commented Mar 31, 2022

Addon error: Traceback (most recent call last):
  File "recordTraffic.py", line 134, in response
    outFile.write(JSBeautifier.beautify(flow.response.content.decode(charSet), 2))
  File "C:\bin\Python-3.10.4\lib\site-packages\html5print\jsprint.py", line 93, in beautify
    tree = parser.parse(decodeText(js))
  File "C:\bin\Python-3.10.4\lib\site-packages\slimit\parser.py", line 93, in parse
    return self.parser.parse(text, lexer=self.lexer, debug=debug)
  File "C:\bin\Python-3.10.4\lib\site-packages\ply\yacc.py", line 265, in parse
    return self.parseopt_notrack(input,lexer,debug,tracking,tokenfunc)
  File "C:\bin\Python-3.10.4\lib\site-packages\ply\yacc.py", line 971, in parseopt_notrack
    p.callable(pslice)
  File "C:\bin\Python-3.10.4\lib\site-packages\slimit\parser.py", line 1101, in p_case_block
    p[0] = p[2:-1]
  File "C:\bin\Python-3.10.4\lib\site-packages\ply\yacc.py", line 198, in __getitem__
    if n >= 0: return self.slice[n].value
TypeError: '>=' not supported between instances of 'slice' and 'int'

I am using html5print to pretty print JS code in an MITMproxy addon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant