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

Improper __delitem__ definition in TAG_Int_Array #70

Closed
sbliven opened this issue Sep 7, 2013 · 2 comments · Fixed by #71
Closed

Improper __delitem__ definition in TAG_Int_Array #70

sbliven opened this issue Sep 7, 2013 · 2 comments · Fixed by #71

Comments

@sbliven
Copy link
Contributor

sbliven commented Sep 7, 2013

Similar to #64, the delitem in TAG_Int_Array has an extra parameter. This causes Exceptions with pop() and remove().

@sbliven sbliven mentioned this issue Sep 7, 2013
macfreek added a commit that referenced this issue Sep 9, 2013
@macfreek
Copy link
Collaborator

macfreek commented Sep 9, 2013

Thanks!

If you have a small code snippet that failed, I'll make a test case to make sure this type of bug does not resurface.

@sbliven
Copy link
Contributor Author

sbliven commented Sep 9, 2013

The problem should surface when calling pop() on any TAG_int_array:

int_array.pop(0)

Specifically, I came across it when writing a script to reorder my server.dat file:

import os
from nbt import nbt
mcserverdat = os.path.expanduser("~/Library/Application Support/minecraft/servers.dat")
nbtfile = nbt.NBTFile(buffer=open(mcserverdat))
nbtfile["servers"].pop(0) 

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

Successfully merging a pull request may close this issue.

2 participants