anoved / phstl

Convert GDAL rasters (like GeoTIFF heightmaps) to 3D STL surfaces.
MIT License
74 stars 21 forks source link

fixed typos: no parantheses around exceptions, no b infront of binary data #15

Closed NandorKovacs closed 10 months ago

NandorKovacs commented 10 months ago

first error:


$ ./phstl.py 
  File "/home/nandor/tmp/phstl/./phstl.py", line 125
    except RuntimeError, e:
           ^^^^^^^^^^^^^^^
SyntaxError: multiple exception types must be parenthesize

after inserting parantheses:

$ ./phstl.py demo/example.tif out.stl
Traceback (most recent call last):
  File "/home/nandor/tmp/phstl/./phstl.py", line 308, in <module>
    with stlwriter(args.STL, facetcount) as mesh:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nandor/tmp/phstl/./phstl.py", line 68, in __init__
    self.f.write('\0' * 80)
TypeError: a bytes-like object is required, not 'str'

after inserting b'\0' instead of '\0'


$ ./phstl.py demo/example.tif out.stl
Traceback (most recent call last):
  File "/home/nandor/tmp/phstl/./phstl.py", line 354, in <module>
    mesh.add_facet((a, b, c))
  File "/home/nandor/tmp/phstl/./phstl.py", line 81, in add_facet
    self.f.write('\0\0')
TypeError: a bytes-like object is required, not 'str'

after inserting b'\0' instead of '\0\0', it runs

maybe my system is weird, or some python update broke something, i dont know. just letting you know, that this pr fixes it for me, and it works again

NandorKovacs commented 10 months ago

i forgot to look at previous pr's

14 fixes these already