Jump to content

gduthie

Member
  • Posts

    1
  • Joined

  • Last visited

Posts posted by gduthie

  1. Good Day, 

     

    I just attempted to use the script to import snippets from a CSV.  The following message was displayed in Terminal.  Could anyone share some insight on what I may be doing wrong?

     

    python3 importSnippets.py

    Traceback (most recent call last):

      File "/Users/gduthie/Desktop/Snippets/importSnippets.py", line 21, in <module>

        output = json.dumps({"alfredsnippet" : {"snippet" : row['content'], "uid": uid, "name" : row['name'], "keyword" : row['keyword']}}, sort_keys=False, indent=4, separators=(',', ': '))

      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/json/__init__.py", line 234, in dumps

        return cls(

      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/json/encoder.py", line 201, in encode

        chunks = list(chunks)

      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/json/encoder.py", line 431, in _iterencode

        yield from _iterencode_dict(o, _current_indent_level)

      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/json/encoder.py", line 405, in _iterencode_dict

        yield from chunks

      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/json/encoder.py", line 405, in _iterencode_dict

        yield from chunks

      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/json/encoder.py", line 438, in _iterencode

        o = _default(o)

      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/json/encoder.py", line 179, in default

        raise TypeError(f'Object of type {o.__class__.__name__} '

    TypeError: Object of type bytes is not JSON serializable

×
×
  • Create New...