vbuild icon indicating copy to clipboard operation
vbuild copied to clipboard

Error Minimizing JS

Open wspeirs opened this issue 6 years ago • 1 comments

Running the example from the documentation for minimizing JavaScript:

>>> import vbuild
>>> js="""async function  mymethod(...a) {
...     var f=(...a) => {let b=12}
... }
... """
>>> min=vbuild.minimize(js)

Results in the following error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/vbuild.py", line 59, in jsminOnline
    r = json.loads( response.read() )
  File "/usr/lib/python3.5/json/__init__.py", line 312, in loads
    s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/vbuild.py", line 43, in minimize
    return jsminOnline(code)
  File "/usr/local/lib/python3.5/dist-packages/vbuild.py", line 63, in jsminOnline
    raise VBuildException("minimize error: %s" % e)
vbuild.VBuildException: minimize error: the JSON object must be str, not 'bytes'

wspeirs avatar Aug 07 '19 12:08 wspeirs

thanks ! (but in this case : I believe it's a py3.5 specific trouble ...)

manatlan avatar Aug 13 '19 10:08 manatlan