0
Commit Graph

18 Commits

Author SHA1 Message Date
Andrew Chin
e76d364b1e NBT: Use a replacement strategy to deal with undecodable data.
The NBT spec requires that all strings are UTF-8 encoded.  However in
practice, non-UTF-8 data can get into a level.dat file (generally via
some weird user-supplied characters in signs.  This results in the
following error:

    CorruptNBTError: could not parse nbt: 'utf8' codec can't decode byte
    0xc0 in position 3: invalid start byte

This happens often enough that we should just ignore this error by using
the 'replace' strategy to replace the invalid data
2018-09-06 22:20:09 -04:00
Andrew Chin
3938d1889c Better error handling of errors when a world fails to open.
A common case is a corrupt (or empty) level.dat file.  This condition
wasn't properly caught, yielding a less-than-useful stack trace.  Even
more concerning is that this could happen when a user is just running
"overviewer.py" to get a world listing.

This has been fixed to improve the user experience
2016-12-19 10:50:01 -05:00
Aaron Griffith
32fbc1dea2 nbt array lengths are unsigned (see issue #1190) 2015-02-02 04:59:43 -05:00
Aaron Griffith
6e3556ab12 nbt timestamps are probably signed (like time_t)
Besides, we get overflow errors with utime on windows for large
unsigned 32-bit integers.
2013-05-06 18:11:45 -03:00
Andrew Brown
ff0f4fe46e fixed error handling code. Now more robust against corrupt chunks! 2012-03-18 13:52:59 -04:00
Andrew Brown
e9cf747513 Added better error handling for corrupt chunks 2012-03-17 22:56:33 -04:00
Andrew Brown
8206272fc8 Added a cache for open regionfile objects 2012-03-04 18:46:02 -05:00
Andrew Brown
d669034c4c corrected y to z in functions in nbt.py 2012-02-17 20:11:02 -05:00
Andrew Brown
6b449da966 added int array support to nbt.py
(untested) Also removed an extra import that I forgot about earlier.
2012-02-15 18:20:57 -05:00
Aaron Griffith
581ee0906a nbt.py now simply *reads files*, nothing more 2011-12-19 02:03:57 -05:00
Andrew Brown
cd360c3c60 comments adjustment in nbt.py 2011-11-20 10:52:04 -05:00
Andrew Brown
6e2d52ceee This should really raise an error if file not found 2011-11-06 20:35:11 -05:00
Aaron Griffith
8c4dd10824 Revert "small findSigns.py fix -- loading regions with north_direction pre-rotates"
This reverts commit 085d400337.
2011-09-16 14:27:03 -04:00
Aaron Griffith
085d400337 small findSigns.py fix -- loading regions with north_direction pre-rotates
What we want in findSigns.py is the raw map data.
2011-09-16 13:43:20 -04:00
Ryan Rector
02d2ae0e6a Fix tile updates for upper-left and lower-right rotations 2011-08-13 10:51:43 -06:00
Ryan Rector
4ee15e8f44 Code cleanup to simplify upstream merge 2011-08-04 12:49:49 -06:00
Ryan Rector
1b25f187ff Merge remote-tracking branch 'upstream/master' into configurable-north 2011-08-03 20:41:09 -06:00
Aaron Griffith
42596416d9 sdist and install now work
next step is using a custom data dir, and falling back on the package
data dir. Also, fixing --version.
2011-03-29 13:49:50 -04:00