mapsme / omim

🗺️ MAPS.ME — Offline OpenStreetMap maps for iOS and Android
Apache License 2.0
4.57k stars 1.15k forks source link

ERROR env Uncaught exception: 'content-length' #14054

Open another-Ismail opened 3 years ago

another-Ismail commented 3 years ago

Trying to use "maps_generator" , when I run python3.8 -m maps_generator --countries="World, WorldCoasts, Japan_*" I got this error after map downloaded [2020-12-11 02:30:51,836] INFO stages Stage DownloadAndConvertPlanet: finished in 0:00:03.181835 [2020-12-11 02:30:51,837] ERROR env Uncaught exception: 'content-length' Traceback (most recent call last): File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "~/omim/tools/python/maps_generator/main.py", line 300, in main() File "~/omim/tools/python/maps_generator/main.py", line 296, in main generate_maps(env, from_stage) File "~/omim/tools/python/maps_generator/maps_generator.py", line 44, in generate_maps run_generation(env, stages, from_stage) File "~/omim/tools/python/maps_generator/maps_generator.py", line 24, in run_generation generation.run(from_stage) File "~/omim/tools/python/maps_generator/generator/generation.py", line 79, in run self.run_stages() File "~/omim/tools/python/maps_generator/generator/generation.py", line 85, in run_stages stage(self.env) File "~/omim/tools/python/maps_generator/generator/stages.py", line 87, in call return self.apply(env, self.args) File "~/omim/tools/python/maps_generator/generator/stages.py", line 199, in apply method(obj, env, *args, *kwargs) File "~/omim/tools/python/maps_generator/generator/stages_declaration.py", line 62, in apply steps.step_download_and_convert_planet( File "~/omim/tools/python/maps_generator/generator/steps.py", line 55, in step_download_and_convert_planet download_files( File "~/omim/tools/python/maps_generator/utils/file.py", line 147, in download_files pool.starmap( File "/usr/lib/python3.8/multiprocessing/pool.py", line 372, in starmap return self._map_async(func, iterable, starmapstar, chunksize).get() File "/usr/lib/python3.8/multiprocessing/pool.py", line 771, in get raise self._value File "/usr/lib/python3.8/multiprocessing/pool.py", line 125, in worker result = (True, func(args, kwds)) File "/usr/lib/python3.8/multiprocessing/pool.py", line 51, in starmapstar return list(itertools.starmap(args[0], args[1])) File "~/omim/tools/python/maps_generator/utils/file.py", line 57, in download_file file_length = int(response.headers["Content-Length"]) File "~/.local/lib/python3.8/site-packages/requests/structures.py", line 54, in getitem return self._store[key.lower()][1] KeyError: 'content-length'

another-Ismail commented 3 years ago

I added this import urllib.request to file.py and change file_length to : f = urllib.request.urlopen(url) meta = f.info() f.close() file_length = int(meta.get('Content-length')) its working without any errors, But where can I find the .mwm files ? any help please .. thanks

gitdhs commented 3 years ago

I meet the same question, did you find the .mwm files?thanks

gitdhs commented 3 years ago

我将其添加import urllib.request到file.py 并将file_length更改为: f = urllib.request.urlopen(url) meta = f.info() f.close() file_length = int(meta.get('Content-length')) 它可以正常工作,但是在哪里可以找到.mwm文件? 任何帮助请..谢谢

did you change the debug version:1->0