simonw / datasette-publish-fly

Datasette plugin for publishing data using Fly
Apache License 2.0
20 stars 7 forks source link

TypeError: __init__() got an unexpected keyword argument 'capture_output' #4

Closed dazzag24 closed 4 years ago

dazzag24 commented 4 years ago

Hi, I am following instructions in this blog post:

https://fly.io/blog/making-datasets-fly-with-datasette-and-fly/

but have hit this error:

$ datasette publish fly squirrels.db --app squirrelsx Traceback (most recent call last): File "/home/darreng/code/flyio_datasette_example/env/bin/datasette", line 8, in sys.exit(cli()) File "/home/darreng/code/flyio_datasette_example/env/lib/python3.6/site-packages/click/core.py", line 829, in call return self.main(args, kwargs) File "/home/darreng/code/flyio_datasette_example/env/lib/python3.6/site-packages/click/core.py", line 782, in main rv = self.invoke(ctx) File "/home/darreng/code/flyio_datasette_example/env/lib/python3.6/site-packages/click/core.py", line 1259, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/darreng/code/flyio_datasette_example/env/lib/python3.6/site-packages/click/core.py", line 1259, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/darreng/code/flyio_datasette_example/env/lib/python3.6/site-packages/click/core.py", line 1066, in invoke return ctx.invoke(self.callback, ctx.params) File "/home/darreng/code/flyio_datasette_example/env/lib/python3.6/site-packages/click/core.py", line 610, in invoke return callback(args, *kwargs) File "/home/darreng/code/flyio_datasette_example/env/lib/python3.6/site-packages/datasette_publish_fly/init.py", line 106, in fly apps = existing_apps() File "/home/darreng/code/flyio_datasette_example/env/lib/python3.6/site-packages/datasette_publish_fly/init.py", line 119, in existing_apps process = run(["flyctl", "apps", "list"], capture_output=True) File "/usr/lib/python3.6/subprocess.py", line 423, in run with Popen(popenargs, **kwargs) as process: TypeError: init() got an unexpected keyword argument 'capture_output'

But it appears that capture_output is new in Python 3.7.

Should the README be updated to indicate that 3.7 in required? or could you accomodate older versions using the PIPE workaround detailed here: https://stackoverflow.com/questions/53209127/subprocess-unexpected-keyword-argument-capture-output

Thanks Darren

simonw commented 4 years ago

Oh good catch. Yeah I'd like this to work in 3.6.

simonw commented 4 years ago

It would have been good if the unit tests had caught this.