UnicodeError: ASCII decoding error: ordinal not in range(128)

Gerhard Häring gerhard.haering at gmx.de
Sat Jul 20 09:16:18 EDT 2002


Alex Martelli wrote in comp.lang.python:
> eugene kim wrote:
> 
>> thx again..
>> 
>> i got PyGreSQL(pyPgSQL gave me error ImportError: No module named libpq)
>> i looked at

Well, for nearly all database modules you must actually compile them
(they have parts written in C). How to do this for pyPgSQL is
described in the README, and in the setup.py. For Debian and FreeBSD,
it is available as packages from your distribution (look into the FAQ
at http://pypgsql.sf.net for details).

>>>>>help(pgdb)
>> that was about all docs i could get including from web

Check out the docs for the Python interface to the "Redhat database",
which is just Redhat's fancy term for their supported version of
PostgreSQL. It describes using pgdb, the DB-API2 layer of PyGreSQL in
great detail. Link below.

> Can't help you much here -- I use psycopg for the same task (interfacing
> to PostgreSQL).  You'll find that most DB interface modules more or less
> follow the Python DB API, 
> 
> http://www.python.org/topics/database/DatabaseAPI-2.0.html
> 
> http://www.amk.ca/python/writing/DB-API.html
> (excellent, though it explains the previous DBAPI 1.0 so some
> detailed differences are inevitable)
> 
> http://initd.org/pub/software/psycopg/dbapi20programming.tar.gz
> (you need TeX to format this one)

Here's a very good one for PyGreSQL:
http://www.redhat.com/support/resources/howto/database/database_python/

I've already got permission from its author to adapt this for my
planned pyPgSQL handbook, which will also allow me to learn some more
Docbook/XML :)

Gerhard
-- 
mail:   gerhard <at> bigfoot <dot> de       registered Linux user #64239
web:    http://www.cs.fhm.edu/~ifw00065/    OpenPGP public key id AD24C930
public key fingerprint: 3FCC 8700 3012 0A9E B0C9  3667 814B 9CAA AD24 C930
reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))



More information about the Python-list mailing list