From 0fe107ecc694bb40e41da0bc2ce49cc04e3fd54d Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Sun, 16 Jun 2019 17:25:51 +0200 Subject: [PATCH] Fix fetch_data on python 3 --- lib/galaxy/datatypes/sniff.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/galaxy/datatypes/sniff.py b/lib/galaxy/datatypes/sniff.py index 0e226346304..bf21e846004 100644 --- a/lib/galaxy/datatypes/sniff.py +++ b/lib/galaxy/datatypes/sniff.py @@ -76,6 +76,8 @@ def stream_to_open_named_file(stream, fd, filename, source_encoding=None, source else: # Compressed files must be encoded after they are uncompressed in the upload utility, # while binary files should not be encoded at all. + if isinstance(chunk, text_type): + chunk = chunk.encode(target_encoding, target_error) os.write(fd, chunk) os.close(fd) return filename