l0b0 / mian

Mine analysis - Graph blocks to height in a Minecraft save game
https://github.com/l0b0/mian/wiki
GNU General Public License v3.0
14 stars 4 forks source link

AttributeError: 'NoneType' object has no attribute 'close' #2

Closed Fenixin closed 13 years ago

Fenixin commented 13 years ago

Beautiful tool!

I'm trying to run it but always stops with the same error:

 mian .minecraft/saves/World1
Traceback (most recent call last):
  File "/usr/local/bin/mian", line 9, in 
    load_entry_point('mian==0.8.3', 'console_scripts', 'mian')()
  File "/usr/local/lib/python2.6/dist-packages/mian-0.8.3-py2.6.egg/mian/mian.py", line 222, in main
    mian(world_dir, bt_hexes, nether)
  File "/usr/local/lib/python2.6/dist-packages/mian-0.8.3-py2.6.egg/mian/mian.py", line 170, in mian
    nbtfile.file.close()
AttributeError: 'NoneType' object has no attribute 'close'

I'm doing something wrong?

l0b0 commented 13 years ago

Thank you!

Which command did you use to run mian?

Fenixin commented 13 years ago

Sorry, I thought it was in the comment... here it is!

mian .minecraft/saves/World5
l0b0 commented 13 years ago

Strange; that works for me. If you ls .minecraft/saves/World5, do you get a list of files? It looks like the problem is that it can't find the path. I'll add some more verification code for that.

l0b0 commented 13 years ago

Can you please try to install the newest version - sudo easy_install -U mian? It should at the very least give a more useful error message.

Fenixin commented 13 years ago

I've removed some strange stuff from the save dir and updated mian as you says.The strange stuff is because I use Minecraft-Overviewer and also some inventory editor (to test it), but it still gives the same error... or similar. After removing things the ls gives:

ls .minecraft/saves/World5
0  1  18  19  1a  1b  1c  1d  1e  1f  1g  1h  1i  1j  1k  1l  1m  1n  1o  1p  1q  1r  2  3  4  5  6  level.dat  level.dat_old  session.lock

And when I run mian it gives:

mian .minecraft/saves/World5
Traceback (most recent call last):
  File "/usr/local/bin/mian", line 9, in 
    load_entry_point('mian==0.8.5', 'console_scripts', 'mian')()
  File "/usr/local/lib/python2.6/dist-packages/mian-0.8.5-py2.6.egg/mian/mian.py", line 246, in main
    mian(world_dir, bt_hexes, nether)
  File "/usr/local/lib/python2.6/dist-packages/mian-0.8.5-py2.6.egg/mian/mian.py", line 177, in mian
    nbtfile.file.close()
AttributeError: 'NoneType' object has no attribute 'close'

I also tried with a clean world, a new generated world, just in case, and it says exactly the same.

mian .minecraft/saves/World3
Traceback (most recent call last):
  File "/usr/local/bin/mian", line 9, in 
    load_entry_point('mian==0.8.5', 'console_scripts', 'mian')()
  File "/usr/local/lib/python2.6/dist-packages/mian-0.8.5-py2.6.egg/mian/mian.py", line 246, in main
    mian(world_dir, bt_hexes, nether)
  File "/usr/local/lib/python2.6/dist-packages/mian-0.8.5-py2.6.egg/mian/mian.py", line 177, in mian
    nbtfile.file.close()
AttributeError: 'NoneType' object has no attribute 'close'
l0b0 commented 13 years ago

It looks like maybe the parser doesn't like the file format. There's a new version available which shouldn't crash on file close now; how does it work for you? You might see an empty graph.

Also, which version of Minecraft do you have, and do you have any plugins, extensions or such installed? mian has worked with every vanilla version since it was first released, but it hasn't been tested with anything non-standard or really old versions.

Fenixin commented 13 years ago

Now it works perfect! Thanks a lot!

I use the vanilla updated version of minecraft. Minecraft-Overviewer is mapper utility that creates high resolution maps with the google maps api. By default it creates the cache in the same directory of the save. That is what I removed.

Fenixin commented 13 years ago

closing