mapbox / tilesets-cli

CLI for interacting with the Mapbox Tilesets API and Mapbox Tiling Service
https://docs.mapbox.com/mapbox-tiling-service
BSD 2-Clause "Simplified" License
125 stars 27 forks source link

Adding an empty geojson source fails with unbound variable error #32

Closed sansumbrella closed 4 years ago

sansumbrella commented 5 years ago

When attempting to add an empty geojson source to my account, the cli crashes. I am attempting to upload an empty file so I can later copy data to my source from an S3 bucket.

tilesets add-source $USER $SOURCE tmp.geojson
Traceback (most recent call last):
  File "/Users/davidwicks/.pyenv/versions/3.6.5/bin/tilesets", line 11, in 
    load_entry_point('tilesets-cli==0.3.2.dev0', 'console_scripts', 'tilesets')()
  File "/Users/davidwicks/.pyenv/versions/3.6.5/lib/python3.6/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/Users/davidwicks/.pyenv/versions/3.6.5/lib/python3.6/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/Users/davidwicks/.pyenv/versions/3.6.5/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/davidwicks/.pyenv/versions/3.6.5/lib/python3.6/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/davidwicks/.pyenv/versions/3.6.5/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/davidwicks/.pyenv/versions/3.6.5/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/davidwicks/.pyenv/versions/3.6.5/lib/python3.6/site-packages/tilesets/scripts/cli.py", line 329, in add_source
    r = requests.post(url, files={"file": ("tileset-source", io)})
UnboundLocalError: local variable 'url' referenced before assignment
Gerdie commented 4 years ago

should be resolved by https://github.com/mapbox/tilesets-cli/pull/30

dianeschulze commented 4 years ago

@sansumbrella please re-open and add more info if this was not resolved by #30. Thanks!