Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writes Kubernetes logs files in UTF-8 #2528

Merged
merged 3 commits into from Jun 29, 2016

Conversation

Projects
None yet
3 participants
@pcm32
Copy link
Member

commented Jun 22, 2016

To avoid exceptions produced when trying to write non-ascii characters present in logs output.

Writes logs files in UTF-8 to avoid exceptions produced when trying t…
…o write non-ascii characters present in logs output.

@galaxybot galaxybot added the triage label Jun 22, 2016

@galaxybot galaxybot added this to the 16.07 milestone Jun 22, 2016

@@ -267,7 +267,7 @@ def __produce_log_file(self, job_state):
logs += "\n\n==== Pod " + pod.name + " log end ===="
logs_file_path = job_state.output_file
logs_file = open(logs_file_path, mode="w")
logs_file.write(logs)
logs_file.write(logs.encode('utf8'))

This comment has been minimized.

Copy link
@nsoranzo

nsoranzo Jun 22, 2016

Member

I think this is safer:

from six import text_type
...

        if isinstance(logs, text_type):
            logs = logs.encode('utf8')
        logs_file.write(logs)

This comment has been minimized.

Copy link
@pcm32

pcm32 Jun 23, 2016

Author Member

Thanks @nsoranzo, I have implemented this suggestion now.

@nsoranzo

This comment has been minimized.

Copy link
Member

commented Jun 24, 2016

👍

Merge pull request #5 from galaxyproject/dev
keeps up to date with main galaxy dev
@nsoranzo

This comment has been minimized.

Copy link
Member

commented Jun 29, 2016

@galaxybot test this

@nsoranzo nsoranzo merged commit 79bf27e into galaxyproject:dev Jun 29, 2016

3 of 4 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
api test Build finished. 219 tests run, 0 skipped, 0 failed.
Details
framework test Build finished. 110 tests run, 0 skipped, 0 failed.
Details
toolshed test Build finished. 582 tests run, 0 skipped, 0 failed.
Details

@nsoranzo nsoranzo added kind/bug area/jobs and removed triage labels Jun 29, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.