Ok, thanks

It must be my server... It seems to work fine with my dev machine.

Richard

On Tue, Dec 18, 2012 at 12:05 PM, Massimo Di Pierro <
[email protected]> wrote:

> Are other people having problems with psycopg2 and web2py 2.3.2? Nothing
> should have changed in this respect. psycopg2 if available takes
> precendence over pg8000 which has problems.
>
> Massimo
>
>
> On Tuesday, 18 December 2012 10:46:16 UTC-6, Richard wrote:
>
>> Is there something different with psycopg2 under web2py 2.3.2 ?
>>
>> I get this error on a new server that I configure :
>>
>> <type 'exceptions.RuntimeError'> Failure to connect, tried 5 times:
>> Traceback (most recent call last): File 
>> "/home/www-data/web2py/gluon/**dal.py",
>> line 6853, in __init__ self._adapter = ADAPTERS[self._dbname](****kwargs)
>> File "/home/www-data/web2py/gluon/**dal.py", line 2493, in __init__ if
>> do_connect: self.find_driver(adapter_args,**uri) File
>> "/home/www-data/web2py/gluon/**dal.py", line 704, in find_driver raise
>> RuntimeError("driver %s not available" % request_driver) RuntimeError:
>> driver psycopg2 not available
>>
>> python-psycopg2 is installed
>>
>> For some reason I had to add apdater to my connection string like this :
>>
>> db=DAL('postgres:psycopg2:...)
>>
>> Because if I didn't not precise it, web2py seems to use pg8000 and I get
>> this error with pg8000 :
>>
>> <type 'exceptions.ValueError'> invalid literal for int() with base 10:
>> 'SELECT'
>>
>> Traceback (most recent call last):
>>   File "/home/www-data/web2py/gluon/**restricted.py", line 212, in
>> restricted
>>     exec ccode in environment
>>   File "/home/www-data/web2py/**applications/sgddms/models/**dict.py",
>> line 121, in <module>
>>     for r in db().select(db.dict_database.**table_name,
>> db.dict_database.column_name, db.dict_database.column_name_**en_ui)])
>>   File "/home/www-data/web2py/gluon/**dal.py", line 8905, in select
>>     return adapter.select(self.query,**fields,attributes)
>>   File "/home/www-data/web2py/gluon/**dal.py", line 1631, in select
>>     return self._select_aux(sql,fields,**attributes)
>>   File "/home/www-data/web2py/gluon/**dal.py", line 1597, in _select_aux
>>     rows = self._fetchall()
>>   File "/home/www-data/web2py/gluon/**dal.py", line 1590, in _fetchall
>>     return self.cursor.fetchall()
>>   File "/home/www-data/web2py/gluon/**contrib/pg8000/dbapi.py", line
>> 246, in _fn
>>     return fn(self, *args, **kwargs)
>>   File "/home/www-data/web2py/gluon/**contrib/pg8000/dbapi.py", line
>> 414, in fetchall
>>     return tuple(self.cursor.iterate_**tuple())
>>   File "/home/www-data/web2py/gluon/**contrib/pg8000/interface.py", line
>> 76, in next
>>     retval = self.func(self.obj)
>>   File "/home/www-data/web2py/gluon/**contrib/pg8000/interface.py", line
>> 270, in read_tuple
>>     return self._fetch()
>>   File "/home/www-data/web2py/gluon/**contrib/pg8000/interface.py", line
>> 205, in _fetch
>>     self._fill_cache()
>>   File "/home/www-data/web2py/gluon/**contrib/pg8000/interface.py", line
>> 190, in _fill_cache
>>     end_of_data, rows = self.c.fetch_rows(self._**portal_name,
>> self.row_cache_size, self._row_desc)
>>   File "/home/www-data/web2py/gluon/**contrib/pg8000/protocol.py", line
>> 943, in _fn
>>     return fn(self, *args, **kwargs)
>>   File "/home/www-data/web2py/gluon/**contrib/pg8000/protocol.py", line
>> 1249, in fetch_rows
>>     retval = reader.handle_messages()
>>   File "/home/www-data/web2py/gluon/**contrib/pg8000/protocol.py", line
>> 906, in handle_messages
>>     msg = self._conn._read_message()
>>   File "/home/www-data/web2py/gluon/**contrib/pg8000/protocol.py", line
>> 1038, in _read_message
>>     msg = message_types[message_code].**createFromData(bytes)
>>   File "/home/www-data/web2py/gluon/**contrib/pg8000/protocol.py", line
>> 783, in createFromData
>>     args['rows'] = int(values[-1])
>> ValueError: invalid literal for int() with base 10: 'SELECT'
>>
>>
>> I never really use pg8000, because it didn't works for me, maybe because
>> of my app code or issue with pg8000 in web2py, but I am more inclined in
>> the former (my app code).
>>
>>
>> I use ubuntu 12.10 and a custom Nginx installation with uwsgi emperor
>> mode.
>>
>> Could it be only because web2py is missing a dependance?
>>
>> Thanks
>>
>> Richard
>>
>>
>> On Tue, Dec 18, 2012 at 5:23 AM, Niphlod <[email protected]> wrote:
>>
>>> totally unrelated.... epydoc folder in examples/static is 22mb. Leaving
>>> that one out and artwork.tar.gz (that seems to be a compressed version of
>>> examples/static/images) takes the compressed binary down to ~10 MB
>>> compressed/25MB uncompressed.
>>> Maybe a little cleanup in the next release will save everyone a few MB ?
>>>
>>>
>>> On Tuesday, December 18, 2012 9:20:54 AM UTC+1, apps in tables wrote:
>>>>
>>>> sorry, both are 45 mb after unzipping, (examples application 25 mb).
>>>>
>>>> On Tuesday, December 18, 2012 7:34:22 AM UTC+3, Massimo Di Pierro wrote:
>>>>>
>>>>> Are you sure about this? I cannot explain it. What's in the extra
>>>>> +30MB?
>>>>>
>>>>> On Monday, 17 December 2012 21:27:44 UTC-6, apps in tables wrote:
>>>>>>
>>>>>>
>>>>>> another advantage:
>>>>>>
>>>>>> 2.3.1 is 45 mb
>>>>>> 2.3.2 is 15 mb
>>>>>>
>>>>>> smaller is nicer...:)
>>>>>>
>>>>>>
>>>>>> On Monday, December 17, 2012 6:11:19 PM UTC+3, Massimo Di Pierro
>>>>>> wrote:
>>>>>>>
>>>>>>> It is the same as 2.3.2 but fixed a major bug with NEWINSTALL being
>>>>>>> ignored and therefore not creating the welcome.w2p for the new 
>>>>>>> scaffolding
>>>>>>> app.
>>>>>>>
>>>>>>> If you are using 2.3.1 you may still be using an older welcome
>>>>>>> instead of the cool new one. Upgrade to 2.3.2 to fix this.
>>>>>>>
>>>>>>> Massimo
>>>>>>>
>>>>>>  --
>>>
>>>
>>>
>>>
>>
>>  --
>
>
>
>

-- 



Reply via email to