Closed savelov closed 4 years ago
remaining error from zipfile creation
File "/home/eugene/radar-wms/baltrad_wms_tools.wsgi", line 173, in application, referer: http://localhost/dem content, filename = time_series("kmz",start_time,end_time,layer_name), referer: http://localhost/demo/demo. File "/home/eugene/radar-wms/baltrad_wms_tools.wsgi", line 150, in time_series, referer: http://localhost/dem kmz_file.write( kmz_files[filename], filename.replace("_path", "." + kmz_files[filename].split(".")[-1]), z File "/usr/lib/python3.7/zipfile.py", line 1746, in write, referer: http://localhost/demo/demo.html with open(filename, "rb") as src, self.open(zinfo, 'w') as dest:, referer: http://localhost/demo/demo.html File "/usr/lib/python3.7/zipfile.py", line 1473, in open, referer: http://localhost/demo/demo.html return self._open_to_write(zinfo, force_zip64=force_zip64), referer: http://localhost/demo/demo.html File "/usr/lib/python3.7/zipfile.py", line 1586, in _open_to_write, referer: http://localhost/demo/demo.html self.fp.write(zinfo.FileHeader(zip64)), referer: http://localhost/demo/demo.html TypeError: string argument expected, got 'bytes', referer: http://localhost/demo/demo.html Exception ignored in: <function ZipFile.del at 0x7efc11cf9950>, referer: http://localhost/demo/demo.html Traceback (most recent call last):, referer: http://localhost/demo/demo.html File "/usr/lib/python3.7/zipfile.py", line 1792, in del, referer: http://localhost/demo/demo.html self.close(), referer: http://localhost/demo/demo.html File "/usr/lib/python3.7/zipfile.py", line 1810, in close, referer: http://localhost/demo/demo.html self._write_end_record(), referer: http://localhost/demo/demo.html File "/usr/lib/python3.7/zipfile.py", line 1914, in _write_end_record, referer: http://localhost/demo/demo.ht self.fp.write(endrec), referer: http://localhost/demo/demo.html TypeError: string argument expected, got 'bytes', referer: http://localhost/demo/demo.html
https://stackoverflow.com/questions/18457678/python-write-in-memory-zip-to-file fix was to replace StringIO() with BytesIO()
1) clicking on nodata values - error in baltrad_wms.wsgi:27 TypeError: sequence of byte string values expected, value of type str found 2) dowload geotiff - baltrad_wms_tools.wsgi:39
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbc in position 18: invalid start byte 3) generate kmz - baltrad_wms_tools.wsgi:102 AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'name',