splunk-sdk-python icon indicating copy to clipboard operation
splunk-sdk-python copied to clipboard

Issue with splunklib searchcommand validators in python 3

Open dagarwal3 opened this issue 7 years ago • 1 comments

TypeError at "/opt/splunk/etc/apps/splunk_app_infrastructure/bin/external_lib/splunklib/searchcommands/validators.py", line 270 : "delimiter" must be string, not bytes

Python 3.7

If I change delimiter, quotechar and lineterminator to unicode, I don't see errors.

class List(Validator):
    """ Validates a list of strings

    """
    class Dialect(csv.Dialect):
        """ Describes the properties of list option values. """
        strict = True
        delimiter = b','
        quotechar = b'"'
        doublequote = True
       lineterminator = b'\n'
        skipinitialspace = True
        quoting = csv.QUOTE_MINIMAL

dagarwal3 avatar Aug 27 '19 21:08 dagarwal3

Fixed and closed: https://github.com/splunk/splunk-sdk-python/commit/79ad17a8ec2576bbd7de70475cbf7b547ffca5b7

amysutedja avatar Sep 09 '20 20:09 amysutedja