Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7739333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:29:47+00:00 2026-06-01T08:29:47+00:00

I am a beginner SQLite user and has run into some trouble, hoping to

  • 0

I am a beginner SQLite user and has run into some trouble, hoping to find someone who could help.

I am trying to read some data out of a database, put it into a variable in python and print it out onto a HTML page.

The table inside the database is calle “Status”, it contains two columns “stamp” and “messages”. “stamp is an INT containing a time stamp, and “messages” contains a TEXT.

@cherrypy.expose
def comment(self, ID = None):
    con = lite.connect('static/database/Status.db')
    output = ""
    with con:    
        cur = con.cursor()    
        cur.execute("SELECT * FROM Status WHERE stamp = ?", (ID,))
        temp = cur.fetchone()
        output = temp[0]

    comments = self.readComments(ID)


    page = get_file(staticfolder+"/html/commentPage.html")
    page = page.replace("$Status", output)

The error I am getting reads:

Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/cherrypy/_cprequest.py", line 606, in respond
    cherrypy.response.body = self.handler()
  File "/usr/lib/pymodules/python2.7/cherrypy/_cpdispatch.py", line 25, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "proj1base.py", line 184, in comment
    page = page.replace("$Status", output)
TypeError: expected a character buffer object

I was wondering if anyone could help me clarify what a character buffer object is, and how do i use one in order for my code to work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T08:29:48+00:00Added an answer on June 1, 2026 at 8:29 am

    Replace “character buffer” by “string” for starters. (There are more types exposing the “buffer protocol” in Python, but don’t bother with them for now.) Most likely, output ended up not being a string. Log its type in the line before the error.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a beginner in SQLite, so please bear with me if what i'm
What resources are great to provide information on using SQLite for beginner iPhone developers?
Beginner help needed :) I am doign an example form a php book which
PHP beginner working from a tutorial. I'm trying to do a simple upload from
Beginner here: In this answer to my question of how to insert data into
I'm a beginner with sqlite coming from mysql. maybe my question is dumb but
I was trying to figure out how to work with SQLite database using python,
Beginner here so please be patient. I am having a bit of a trouble
A beginner's question: I am trying to remove a subview after having added it
Beginner's question: I dared to introduce constants into my little program. I first resisted,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.