How do I use fiona.open() to write to a file-like object like StringIO or BytesIO?


joe.huang@...
 

I try passing the object directly into fiona.open(), but it throws a type error: string argument expected, got 'bytes'


Sean Gillies
 

Hi,

The project has an example for you in the test suite: https://github.com/Toblerity/Fiona/blob/master/tests/test_memoryfile.py#L69-L71.

Are you using the latest version of fiona? Can you show us the full exception traceback so we can see what line it's coming from?


On Tue, Jun 18, 2019 at 4:23 PM <joe.huang@...> wrote:
I try passing the object directly into fiona.open(), but it throws a type error: string argument expected, got 'bytes'



--
Sean Gillies


joe.huang@...
 

Your example did the trick. Thank you so much!

By the way, thank you so much for being so quick and responsive! You are an awesome member of the open source community.