diff --git a/lib/galaxy/tools/parameters/basic.py b/lib/galaxy/tools/parameters/basic.py index bd81494e7eb..a7f2617b1a0 100644 --- a/lib/galaxy/tools/parameters/basic.py +++ b/lib/galaxy/tools/parameters/basic.py @@ -2,7 +2,6 @@ Basic tool parameters. """ import logging -import numbers import os import os.path import re @@ -131,8 +130,6 @@ class ToolParameter( object, Dictifiable ): def to_python( self, value, app ): """Convert a value created with to_json back to an object representation""" - if isinstance( value, numbers.Number ): - return unicodify( value ) return value def value_to_basic( self, value, app, use_security=False ): diff --git a/lib/galaxy/util/json.py b/lib/galaxy/util/json.py index 2f38b96ccc8..6bd11fc73fd 100644 --- a/lib/galaxy/util/json.py +++ b/lib/galaxy/util/json.py @@ -56,10 +56,13 @@ def swap_inf_nan( val ): def safe_loads( arg ): """ This is a wrapper around loads that returns the parsed value instead of - raising a value error. + raising a value error. It also avoids autoconversion of non-iterables + i.e numeric and boolean values. """ try: loaded = json.loads( arg ) + if loaded is not None and not isinstance( loaded, collections.Iterable ): + loaded = arg except ( TypeError, ValueError ): loaded = arg return loaded