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

  • Home
  • SEARCH
  • 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 6004407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:15:33+00:00 2026-05-23T01:15:33+00:00

I could be mistaken but since I backtracked to python 2.7 from 3.2 I’ve

  • 0

I could be mistaken but since I backtracked to python 2.7 from 3.2 I’ve noticed something sqlite3 is doing that I don’t like…

When I use to use my cursor.fetch method it would return (1, x, x, x) from my table

but in 2.7 its returning (1, u’x’ ,u’x’ ,u’x’)

How do I get it to stop returning that ‘u’ in my queries? I need to store the return values in variables and it’s kind of irritating having to problem solve this.

Edit: Through a little research I’ve found a way…

db.text_factory = str

if there is a better way please inform me as I really don’t even know what this method does, hate to be changing the wrong thing

  • 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-05-23T01:15:33+00:00Added an answer on May 23, 2026 at 1:15 am

    Sigh.

    (1, u'x' ,u'x' ,u'x') is a tuple. That tuple contains four elements. One of them is an integer, the other three are unicode strings, as indicated by the u.

    If you print the entire tuple at once, it will look like the above. But that’s a silly thing to do, because presumably you actually want to do something with the contents of the tuple, not the tuple itself.

    If you did print result[1], you would see the output is just x: the u is not shown when you actually print it. That is the correct behaviour.

    If you use the code you post, as soon as you retrieve a non-ASCII value from your datastore – someone whose name contains an accented character, for example – things will go horribly wrong.

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

Sidebar

Related Questions

Could somebody please name a few. I could given time, but this is for
I understand why Python requires explicit self qualifier when referring to instance attributes. But
I have searched this web looking for an answer, but it seems that this
One of the barriers (that as far as I know was never removed, but
I have some random HTML layouts that contain important text I would like to
I recently spent a long while debugging something that turned out to be an
I'll ask this with a Scala example, but it may well be that this
Could someone recommend any good resources for creating Graphics User Interfaces, preferably in C/C++?
Could someone tell me what the units the SetTimeout(int) method in the ICriteria interface
Could somebody please do a rundown of how to programmatically encrypt a config-file in

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.