graphite-project/carbonate

1.1.8 sync broken on python3

filippog opened this issue · 3 comments

Hello,
thank you for carbonate! Super useful. I'm trying 1.1.8 on python3 and sync_from_remote is broken for me:

Traceback (most recent call last):
  File "/usr/bin/carbon-sync", line 34, in <module>
    sys.exit(load_entry_point('carbonate==1.1.8', 'console_scripts', 'carbon-sync')())
  File "/usr/lib/python3/dist-packages/carbonate/cli.py", line 272, in carbon_sync
    run_batch(metrics_to_sync, remote,
  File "/usr/lib/python3/dist-packages/carbonate/sync.py", line 151, in run_batch
    sync_success = sync_from_remote(sync_file, remote, staging_dir,
  File "/usr/lib/python3/dist-packages/carbonate/sync.py", line 34, in sync_from_remote
    sys.stdout.write(line.decode("utf-8"))
AttributeError: 'str' object has no attribute 'decode'

I'm not super familiar with the code, though I'm wondering why the iteration on stdout at all, instead of leaving stdout/stderr alone and let communicate() do the work/flushing?

I ran into this recently, I should have an MR shortly

This is resolved in master with the merge of #128