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

Error when loading bundle file #25

Closed
jack980517 opened this issue Jan 18, 2017 · 1 comment
Closed

Error when loading bundle file #25

jack980517 opened this issue Jan 18, 2017 · 1 comment

Comments

@jack980517
Copy link

>>> bundle=unitypack.load(f)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jack980517/python-modules/UnityPack/unitypack/__init__.py", line 11, in load
    return env.load(file)
  File "/home/jack980517/python-modules/UnityPack/unitypack/environment.py", line 21, in load
    ret.load(file)
  File "/home/jack980517/python-modules/UnityPack/unitypack/assetbundle.py", line 36, in load
    self.signature = buf.read_string()
  File "/home/jack980517/python-modules/UnityPack/unitypack/utils.py", line 70, in read_string
    ret = self.read_cstring()
  File "/home/jack980517/python-modules/UnityPack/unitypack/utils.py", line 83, in read_cstring
    c = self.read(1)
  File "/home/jack980517/python-modules/UnityPack/unitypack/utils.py", line 60, in read
    return self.buf.read(*args)
  File "/usr/lib64/python3.5/codecs.py", line 321, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x9d in position 37: invalid start byte
@jack980517
Copy link
Author

Solved: instead of open("example.unity3d") as written in the readme, open("example.unity3d",'rb') is required. Not specifying rb would result in the file being read as text rather than binary, and would have some weird issues like this one.

jack980517 added a commit to jack980517/UnityPack that referenced this issue Jan 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant