• 0

    posted a message on NBT Parser for Python
    This is a great resource. Thanks for making it available.

    I easy installed the most recent version of the NBT module a couple of days ago. I can read nbt files fine but I am having trouble writing files. File writing proceeds without throwing up any errors. However, I am unable to subsequently read nbt files created with the write_file() function.

    Could you please take a moment to look at the following output and advise me what I should be doing? The test below uses the standard bigtest.nbt test data.

    >>> nbtfile = nbt.NBTFile("bigtest.nbt",'rb')
    >>> nbtfile.write_file("newnbtfile.nbt")
    >>> newnbtfile = nbt.NBTFile("newnbtfile.nbt",'rb')
    
    Traceback (most recent call last):
      File "<pyshell#7>", line 1, in <module>
        newnbtfile = nbt.NBTFile("newnbtfile.nbt",'rb')
      File "build\bdist.win32\egg\nbt\nbt.py", line 249, in __init__
        self.parse_file(self.file)
      File "build\bdist.win32\egg\nbt\nbt.py", line 258, in parse_file
        type = TAG_Byte(buffer=file)
      File "build\bdist.win32\egg\nbt\nbt.py", line 46, in __init__
        self._parse_buffer(buffer)
      File "build\bdist.win32\egg\nbt\nbt.py", line 50, in _parse_buffer
        self.value = unpack(self.fmt, buffer.read(self.size))[0]
    error: unpack requires a string argument of length 1
    >>> 
    Posted in: Mods Discussion
  • To post a comment, please .