Re: Character Encoding Question - Mailing list psycopg

From Daniele Varrazzo
Subject Re: Character Encoding Question
Date
Msg-id CA+mi_8Y=v7jZ2Pjq=-C3f5QqX0qbRFoaeWsAJFEcBMD9VFrSdQ@mail.gmail.com
Whole thread Raw
In response to Re: Character Encoding Question  (Don Parris <parrisdc@gmail.com>)
Responses Re: Character Encoding Question
Re: Character Encoding Question
List psycopg
On Thu, Mar 28, 2013 at 4:34 PM, Don Parris <parrisdc@gmail.com> wrote:
> Thanks Daniele,
>
> I'm using psycopg 2.4.5 with Python 3.2.3 on Kubuntu 12.10.
>
> This is the connection encoding based on a quick check at the Python
> console:
>>>>print(con.encoding)
> SQLASCII

In this case it's natural that you get an error on decode. But is it
really the database encoding? What does this query say:

    cur = con.cursor()
    cur.execute("show client_encoding")
    print cur.fetchone()[0]


> I honestly don't know where the error actually is - not a very advanced
> programmer by any means.  All I really know is that the program breaks when
> I use fetchall(), but it works with fetchone() and fetchmany().  It could
> have something to do with the way my main program module imports the module
> that calls the function, for all I know.  Here is the traceback:

I'll try to load your dataset and play with it, thank you.

-- Daniele


psycopg by date:

Previous
From: Don Parris
Date:
Subject: Re: Character Encoding Question
Next
From: Daniele Varrazzo
Date:
Subject: Re: Character Encoding Question