Lymkwi / python-minetest

A python library to manipulate minetest's files
6 stars 4 forks source link

error when trying demo #2

Closed ghost closed 8 years ago

ghost commented 8 years ago

I am trying to get the demos working, and am hitting an error (I am on a win32 machine with python 2.7.11). here is my error and traceback:

D:\minetest\minetest-0.4.13\python-minetest\src>python demo_schematic_manipulati
on.py import ..\..\worlds\b\map.sqlite ..\..\mods\realterrain\schems\cactus.mts
2016-03-29 12:48:26,342 map:set_maxcachesize         :576  DEBUG    MapVessel's
maximum cache size set to 100
Reading schematic...
2016-03-29 12:48:26,358 schematics:load                     :78   DEBUG    Read
size : (7, 10, 7)
2016-03-29 12:48:26,358 schematics:load                     :95   DEBUG    Which
 makes 490 nodes to read
2016-03-29 12:48:26,358 schematics:load                     :98   DEBUG    Nodes
 read
2016-03-29 12:48:26,358 schematics:load                     :102  DEBUG    Param
1 read
2016-03-29 12:48:26,358 schematics:load                     :106  DEBUG    Param
2 read
Importing schematic..
2016-03-29 12:48:26,375 map:load_mapblock            :589  DEBUG    Loaded mapbl
ock at 302014482.0
2016-03-29 12:48:26,375 map:__init__                 :42   DEBUG    Map object i
nitiated at (18.0, 6, 18)
2016-03-29 12:48:26,453 map:store                    :540  DEBUG    Mapblock 302
014482.0 stored
Traceback (most recent call last):
  File "demo_schematic_manipulation.py", line 49, in 
    db.import_schematic(pos_import, schem, stage_save=5)
  File "D:\minetest\minetest-0.4.13\python-minetest\src\map.py", line 700, in im
port_schematic
    self.init_mapblock(getMapBlockPos(determineMapBlock(v.add(pos, rpos))))
  File "D:\minetest\minetest-0.4.13\python-minetest\src\map.py", line 717, in in
it_mapblock
    self.interface.write(mapblockpos)
  File "D:\minetest\minetest-0.4.13\python-minetest\src\map.py", line 514, in wr
ite
    [self.cache[blockID]])
sqlite3.ProgrammingError: You must not use 8-bit bytestrings unless you use a te
xt_factory that can interpret 8-bit bytestrings (like text_factory = str). It is
 highly recommended that you instead just switch your application to Unicode str
ings.
Lymkwi commented 8 years ago

Could you try the demo with python3.5 please? I strongly suspect that is due to a lack of retrocompatibility from python2.7.

ghost commented 8 years ago

oh ok, i need to find PIL for python3.5 win32

ghost commented 8 years ago

apparently i can't install python 3.5 on windows XP., but the demo works on python 3.4.4

0-afflatus commented 8 years ago

Python3 and Python2 are completely different animals ...

Lymkwi commented 8 years ago

Python3 and Python2 are completely different animals ...

They are, and I chose to use python3 over python2 to develop this library (partly because of the binary objects/byte streams handling python3 has). I haven't checked with python2 but I'm sure it will not run with it.