commit/galaxy-central: jgoecks: Explicitly specify encodings for tool help templates to avoid unicode/ascii confusion.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/35c524274296/ changeset: 35c524274296 user: jgoecks date: 2012-08-10 18:26:43 summary: Explicitly specify encodings for tool help templates to avoid unicode/ascii confusion. affected #: 1 file diff -r 7ac62afbcdf2b983e002b79e52753f9cf142db60 -r 35c524274296c33320190a017bc316b57cb4f759 lib/galaxy/tools/__init__.py --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -1083,7 +1083,9 @@ help_pages = self.help.findall( "page" ) help_header = self.help.text try: - self.help = Template( util.rst_to_html(self.help.text) ) + self.help = Template( util.rst_to_html(self.help.text), input_encoding='utf-8', + output_encoding='utf-8', default_filters=[ 'decode.utf8' ], + encoding_errors='replace' ) except: log.exception( "error in help for tool %s" % self.name ) # Multiple help page case @@ -1093,7 +1095,10 @@ help_footer = help_footer + help_page.tail # Each page has to rendered all-together because of backreferences allowed by rst try: - self.help_by_page = [ Template( util.rst_to_html( help_header + x + help_footer ) ) + self.help_by_page = [ Template( util.rst_to_html( help_header + x + help_footer, + input_encoding='utf-8', output_encoding='utf-8', + default_filters=[ 'decode.utf8' ], + encoding_errors='replace' ) ) for x in self.help_by_page ] except: log.exception( "error in multi-page help for tool %s" % self.name ) Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket