Can't read world because of access violation
I can't read world's chinks and blocks. When I try to do this, the error occours:
Traceback (most recent call last):
File "<pyshell#8>", line 1, in <module>
world.getChunk(0, 0)
File "D:\Users\filips\Downloads\MCPE\venv\lib\site-packages\bedrock-0.1-py3.7.egg\bedrock\bedrock.py", line 30, in getChunk
chunk = Chunk(self.db, x, z)
File "D:\Users\filips\Downloads\MCPE\venv\lib\site-packages\bedrock-0.1-py3.7.egg\bedrock\bedrock.py", line 65, in __init__
self.version = self._loadVersion(db)
File "D:\Users\filips\Downloads\MCPE\venv\lib\site-packages\bedrock-0.1-py3.7.egg\bedrock\bedrock.py", line 82, in _loadVersion
version = ldb.get(db, self.keyBase + b"v")
File "D:\Users\filips\Downloads\MCPE\venv\lib\site-packages\bedrock-0.1-py3.7.egg\bedrock\leveldb.py", line 164, in get
valPtr = ldb.leveldb_get(db, ro, key, len(key), ctypes.byref(size), ctypes.byref(error))
OSError: exception: access violation reading 0x0000000000000000
I'm using Python 3.7 on Windows 10 (64-bit) and with DLLs that are provided in this repository.
did you unzipped the .mcworld file?
Which .mcworld file? I copied worlds from Android phone with Pocket Edition (which is Bedrock), and I just have level.dat, various .ldb and other files.
Can confirm this issue is still happening. I'm using Windows 10 64 bits with Python 3.8.3 and I've tried both the provided DLLs and some compiled by myself. Here's the output:
File "F:\Escritorio\Saves Script\bedrock\leveldb.py", line 161, in get
valPtr = ldb.leveldb_get(db, ro, key, len(key), ctypes.byref(size), ctypes.byref(error))
File "F:\Escritorio\Saves Script\bedrock\bedrock.py", line 95, in _loadVersion
version = ldb.get(db, self.keyBase + b"v")
File "F:\Escritorio\Saves Script\bedrock\bedrock.py", line 78, in __init__
self.version = self._loadVersion(db)
File "F:\Escritorio\Saves Script\bedrock\bedrock.py", line 30, in getChunk
chunk = Chunk(self.db, x, z)
File "F:\Escritorio\Saves Script\main.py", line 4, in <module>
spawnchunk = world.getChunk(0, 0)
I'm unfortunately not particularly familiar with the low level windows/ctypes issue this appears to be, and can't reproduce myself. I'm open to a PR fixing it however.