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

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

Open
Berghopper opened this issue Oct 25, 2018 · 0 comments
Open

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

Berghopper opened this issue Oct 25, 2018 · 0 comments

Comments

@Berghopper
Copy link

Berghopper commented Oct 25, 2018

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?; fabienvauchelles/scrapoxy-python-api#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 :-)

@Berghopper Berghopper changed the title Not working for 1.13.1 Not working for 1.13.1 (probable culprit; python3.5?) Nov 2, 2018
@Berghopper Berghopper changed the title Not working for 1.13.1 (probable culprit; python3.5?) TypeError: the JSON object must be str, not 'bytes' Nov 2, 2018
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