Обсуждение: Error with Zope 2.13.8

Поиск
Список
Период
Сортировка

Error with Zope 2.13.8

От
Frank Kauff
Дата:
Hi all,

I'm trying to run psycopg2-2.4.2 ZPsychopgDA with Zopw 2.13.8. However,
when I try to add the adapter to my zope site and enter the connection
string etc., I get the Zope error below. Any idea what could be the
reason? Some other versions of psycopg2 I tried give the same error

Thanks,
Frank



Zope Error

Zope has encountered an error while publishing this resource.

Error Type: OperationalError
Error Value: no Python codec for client encoding ''

Traceback (innermost last):

     Module ZPublisher.Publish, line 126, in publish
     Module ZPublisher.mapply, line 77, in mapply
     Module ZPublisher.Publish, line 46, in call_object
     Module Products.ZPsycopgDA.DA, line 61, in manage_addZPsycopgConnection
     Module Products.ZPsycopgDA.DA, line 81, in __init__
     Module Products.ZPsycopgDA.DA, line 96, in edit
     Module Products.ZPsycopgDA.DA, line 127, in connect
     Module Products.ZPsycopgDA.db, line 85, in open
     Module Products.ZPsycopgDA.db, line 50, in getconn

OperationalError: no Python codec for client encoding ''

Error: no Python Codec for client encoding

От
Frank Kauff
Дата:
Nobody with any ideas what the problem could be? Any help would be
greatly appreciated.

Frank


On 10/18/2011 02:08 PM, Frank Kauff wrote:
> Hi all,
>
> I'm trying to run psycopg2-2.4.2 ZPsychopgDA with Zopw 2.13.8.
> However, when I try to add the adapter to my zope site and enter the
> connection string etc., I get the Zope error below. Any idea what
> could be the reason? Some other versions of psycopg2 I tried give the
> same error
>
> Thanks,
> Frank
>
>
>
> Zope Error
>
> Zope has encountered an error while publishing this resource.
>
> Error Type: OperationalError
> Error Value: no Python codec for client encoding ''
>
> Traceback (innermost last):
>
>     Module ZPublisher.Publish, line 126, in publish
>     Module ZPublisher.mapply, line 77, in mapply
>     Module ZPublisher.Publish, line 46, in call_object
>     Module Products.ZPsycopgDA.DA, line 61, in
> manage_addZPsycopgConnection
>     Module Products.ZPsycopgDA.DA, line 81, in __init__
>     Module Products.ZPsycopgDA.DA, line 96, in edit
>     Module Products.ZPsycopgDA.DA, line 127, in connect
>     Module Products.ZPsycopgDA.db, line 85, in open
>     Module Products.ZPsycopgDA.db, line 50, in getconn
>
> OperationalError: no Python codec for client encoding ''



Re: Error: no Python Codec for client encoding

От
Daniele Varrazzo
Дата:
On Wed, Oct 19, 2011 at 4:41 PM, Frank Kauff <fkauff@biologie.uni-kl.de> wrote:

>>    Module Products.ZPsycopgDA.db, line 50, in getconn

This line only does

    conn.set_client_encoding(self.encoding)

and self.encoding is passed to the DB constructor. It is configured to
be an empty string, which we don't like. Where does this empty string
come from? I suspect misconfiguration.

-- Daniele

Re: Error: no Python Codec for client encoding

От
"Frank Kauff"
Дата:
Hi Daniele,

it's a standard Zope installation and a psycopg
installation out of the box - so I didn't change any
configuration. How can i configure it so that is no longer
an empty string?

Frank



On Wed, 19 Oct 2011 17:27:12 +0100
  Daniele Varrazzo <daniele.varrazzo@gmail.com> wrote:
> On Wed, Oct 19, 2011 at 4:41 PM, Frank Kauff
><fkauff@biologie.uni-kl.de> wrote:
>
>>>    Module Products.ZPsycopgDA.db, line 50, in getconn
>
> This line only does
>
>    conn.set_client_encoding(self.encoding)
>
> and self.encoding is passed to the DB constructor. It is
>configured to
> be an empty string, which we don't like. Where does this
>empty string
> come from? I suspect misconfiguration.
>
> -- Daniele
>
> --
> Sent via psycopg mailing list (psycopg@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/psycopg

--

Re: Error: no Python Codec for client encoding

От
Daniele Varrazzo
Дата:
On Wed, Oct 19, 2011 at 5:59 PM, Frank Kauff <fkauff@biologie.uni-kl.de> wrote:
> Hi Daniele,
>
> it's a standard Zope installation and a psycopg installation out of the box
> - so I didn't change any configuration. How can i configure it so that is no
> longer an empty string?

I have no idea, I'm not a zope user. Somebody else?

-- Daniele

Re: Error: no Python Codec for client encoding

От
"Frank Kauff"
Дата:
I changed the code from

    conn.set_client_encoding(self.encoding)

to

    conn.set_client_encoding('utf-8')

which seems, according to the code, to be the default (but
somehow wasn't?),

and the connection works.

(Other erros pop up, but might be not related to psycopg)

Thanks for the help!
Frank


On Wed, 19 Oct 2011 17:27:12 +0100
  Daniele Varrazzo <daniele.varrazzo@gmail.com> wrote:
> On Wed, Oct 19, 2011 at 4:41 PM, Frank Kauff
><fkauff@biologie.uni-kl.de> wrote:
>
>>>    Module Products.ZPsycopgDA.db, line 50, in getconn
>
> This line only does
>
>    conn.set_client_encoding(self.encoding)
>
> and self.encoding is passed to the DB constructor. It is
>configured to
> be an empty string, which we don't like. Where does this
>empty string
> come from? I suspect misconfiguration.
>
> -- Daniele
>
> --
> Sent via psycopg mailing list (psycopg@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/psycopg

Re: Error: no Python Codec for client encoding

От
Federico Di Gregorio
Дата:
On 19/10/11 19:08, Daniele Varrazzo wrote:
> On Wed, Oct 19, 2011 at 5:59 PM, Frank Kauff <fkauff@biologie.uni-kl.de> wrote:
>> > Hi Daniele,
>> >
>> > it's a standard Zope installation and a psycopg installation out of the box
>> > - so I didn't change any configuration. How can i configure it so that is no
>> > longer an empty string?
> I have no idea, I'm not a zope user. Somebody else?

Don't know why Zope is passing an empty string. We should probably fix
the DA to use a sane default (UTF-8?)

federico

--
Federico Di Gregorio                                       fog@initd.org
             Quis custodiet ipsos custodes? -- Juvenal, Satires, VI, 347

Re: Error: no Python Codec for client encoding

От
Federico Di Gregorio
Дата:
On 20/10/11 09:45, Federico Di Gregorio wrote:
> On 19/10/11 19:08, Daniele Varrazzo wrote:
>> On Wed, Oct 19, 2011 at 5:59 PM, Frank Kauff <fkauff@biologie.uni-kl.de> wrote:
>>>> Hi Daniele,
>>>>
>>>> it's a standard Zope installation and a psycopg installation out of the box
>>>> - so I didn't change any configuration. How can i configure it so that is no
>>>> longer an empty string?
>> I have no idea, I'm not a zope user. Somebody else?
>
> Don't know why Zope is passing an empty string. We should probably fix
> the DA to use a sane default (UTF-8?)

I just pushed to the devel branch a small change that, if Zope
explicitly pass an empty "enc" argument just converts it to "utf-8".
Frank, can you please clone from:

git://luna.dndg.it/public/psycopg2 (devel branch)

and test it?

federico

--
Federico Di Gregorio                                       fog@initd.org
 - Ma cos'ha il tuo pesce rosso, l'orchite?
 - Si, ha un occhio solo, la voce roca e mangia gli altri pesci.

Re: Error: no Python Codec for client encoding

От
Frank Kauff
Дата:
Hi Federico,

thanks for the change - but I'm not familiar with github, and have no
idea about cloning from the presoitory. The url won't work in Firefox.

Frank


On 10/20/2011 09:54 AM, Federico Di Gregorio wrote:
> On 20/10/11 09:45, Federico Di Gregorio wrote:
>> On 19/10/11 19:08, Daniele Varrazzo wrote:
>>> On Wed, Oct 19, 2011 at 5:59 PM, Frank Kauff<fkauff@biologie.uni-kl.de>  wrote:
>>>>> Hi Daniele,
>>>>>
>>>>> it's a standard Zope installation and a psycopg installation out of the box
>>>>> - so I didn't change any configuration. How can i configure it so that is no
>>>>> longer an empty string?
>>> I have no idea, I'm not a zope user. Somebody else?
>> Don't know why Zope is passing an empty string. We should probably fix
>> the DA to use a sane default (UTF-8?)
> I just pushed to the devel branch a small change that, if Zope
> explicitly pass an empty "enc" argument just converts it to "utf-8".
> Frank, can you please clone from:
>
> git://luna.dndg.it/public/psycopg2 (devel branch)
>
> and test it?
>
> federico
>


Re: Error: no Python Codec for client encoding

От
Federico Di Gregorio
Дата:
On 20/10/11 13:55, Frank Kauff wrote:
> thanks for the change - but I'm not familiar with github, and have no
> idea about cloning from the presoitory. The url won't work in Firefox.

Ok, just drop the attached file into ZPsycopgDA folder.

--
Federico Di Gregorio                                       fog@initd.org
 fog, non capisco perche' devi sempre fare la faccia feroce... non sei
  credibile con quei baffi di cioccolato!              -- macchinavapore

Вложения