Skip to content

TypeError: the JSON object must be str, not 'bytes' #2

@CasperVM

Description

@CasperVM

I know you're busy right now, but just wanted to note that for 1.13.1 the pip install doesn't work.

I get the following error(s);

I am trying to export for texture size 6, because this uses up way less space than if I were to run mapcrafter with 12 or 16.

casper@casper-Lenovo-ideapad-510-15ISK:~/blockcrafter$ blockcrafter-export -a ~/client.jar -o blocks -t 6
WARNING: Traceback (most recent call last):
  File "/home/casper/.local/bin/blockcrafter-export", line 11, in <module>
    load_entry_point('blockcrafter==1.0', 'console_scripts', 'blockcrafter-export')()
  File "/home/casper/.local/lib/python3.5/site-packages/blockcrafter/export.py", line 217, in main
    app.run()
  File "/home/casper/.local/lib/python3.5/site-packages/vispy/app/_default_app.py", line 62, in run
    return default_app.run()
  File "/home/casper/.local/lib/python3.5/site-packages/vispy/app/application.py", line 142, in run
    return self._backend._vispy_run()
  File "/home/casper/.local/lib/python3.5/site-packages/vispy/app/backends/_qt.py", line 229, in _vispy_run
    return app.exec_()
  File "/home/casper/.local/lib/python3.5/site-packages/vispy/app/backends/_qt.py", line 436, in event
    out = super(QtBaseCanvasBackend, self).event(ev)
  File "/home/casper/.local/lib/python3.5/site-packages/vispy/app/backends/_qt.py", line 708, in paintGL
    self._vispy_canvas.events.draw(region=None)
  File "/home/casper/.local/lib/python3.5/site-packages/vispy/util/event.py", line 455, in __call__
    self._invoke_callback(cb, event)
  File "/home/casper/.local/lib/python3.5/site-packages/vispy/util/event.py", line 475, in _invoke_callback
    self, cb_event=(cb, event))
  << caught exception here: >>
  File "/home/casper/.local/lib/python3.5/site-packages/vispy/util/event.py", line 471, in _invoke_callback
    cb(event)
  File "/home/casper/.local/lib/python3.5/site-packages/blockcrafter/export.py", line 188, in on_draw
    blockstates = self.assets.blockstates
  File "/home/casper/.local/lib/python3.5/site-packages/blockcrafter/mcmodel.py", line 361, in blockstates
    blockstates.append(self.get_blockstate(prefix + ":" + name))
  File "/home/casper/.local/lib/python3.5/site-packages/blockcrafter/mcmodel.py", line 347, in get_blockstate
    return Blockstate(self, prefix, name, json.loads(self.source.load_file(path)), properties=properties)
  File "/usr/lib/python3.5/json/__init__.py", line 312, in loads
    s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'
ERROR: Invoking <bound method Canvas.on_draw of <Canvas (PyQt5) at 0x7f20dff20198>> for DrawEvent
Segmentation fault (core dumped)

Also, I have never used docker, it might be nice in the future to add a bit more documentation on how to run the docker? (sorry if I'm just dense and don't know how to use docker).

Edit1; This seems to be an issue with python3.5 specifically?; https://github.com/fabienvauchelles/scrapoxy-python-api/issues/5
Edit2; I have solved the issue, in some cases the object that you tried the load was a bytes object, but not always. I will do a pull request soonish.
Edit3; Did a pull request to fix this issue :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions