sumo
sumo copied to clipboard
Regression in osmGet.py - "not a gzipped file (b'<?')"
Retrieving a map from OSM for the osmWebWizard no longer works for Geofabrik Overpass server. Possible regression in SUMO 1.20.0 - worked fine in SUMO 1.19.0.
To reproduce:
>>> import osmGet
>>> osmGet.get(['-b=13.401374,52.52537,13.40557,52.527044', '-p', 'osm', '-d', '/Users/robert/Git-Repositories/2024-06-26-18-07-12', '-z', '--shapes', '-u', 'http://overpass.geofabrik.de/<redacted>/api/interpreter'])
200 OK
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/robert/Git-Repositories/sumo/tools/osmGet.py", line 261, in get
readCompressed(options, conn, url.path, '<bbox-query n="%s" s="%s" w="%s" e="%s"/>' %
File "/Users/robert/Git-Repositories/sumo/tools/osmGet.py", line 162, in readCompressed
lines = gzip.decompress(response.read())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.12.4/Frameworks/Python.framework/Versions/3.12/lib/python3.12/gzip.py", line 627, in decompress
if _read_gzip_header(fp) is None:
^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.12.4/Frameworks/Python.framework/Versions/3.12/lib/python3.12/gzip.py", line 456, in _read_gzip_header
raise BadGzipFile('Not a gzipped file (%r)' % magic)
gzip.BadGzipFile: Not a gzipped file (b'<?')
(API Key redacted and sent via mattermost)