title: sqlalchemy.exc.StatementError: (builtins.TypeError) memoryview: a bytes-like object is required, not 'str'
body: <p>I am trying to store an object in sqlite database using python and SQLAlchemy ORM.
  Below is my code<br>
  <strong>Snippet for storing to sqlite db</strong></p>
  
  <pre><code>command='some command'# a str variable  containing some value
  length = len(command) # length of string 
  mycommand = Command(command, length, 0, 'nothing') # instantiating object
  Session.add(mycommand )
  Session.commit()
  </code></pre>
  
  <p><strong>Snippet for creating session object</strong></p>
  
  <pre><code>engine = create_engine('sqlite:///commands.db', convert_unicode=True)
  Session = sessionmaker(bind=engine)()
  </code></pre>
  
  <p>Now when I try to persist a newly crated object to sqlite db using session.add(obj) I get an error :
  <strong>sqlalchemy.exc.StatementError: (builtins.TypeError) memoryview: a bytes-like object is required,</strong></p>
  
  <p>I have properly created the Command class and mapped its attributes to the corresponding columns in  commands table.
  How should I resolve this error?</p>