Re: [web2py] Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1145: ordinal not in range(128)

2015-07-11 Thread Ben Lawrence
Or just
sudo apt-get install python-psycopg2

as Massimo said, web2py will use psycopg2 before looking for pg8000
:-)great!!

On Monday, June 22, 2015 at 10:13:15 PM UTC-7, Paolo Valleri wrote:
>
> Hi Ben, the latest web2py download doesn't include the fix yet. You have 
> to either manually update pydal or wait for a newer release of web2py
>
>  Paolo
>
> 2015-06-23 6:12 GMT+02:00 Ben Lawrence >:
>
>> Hi Paolo,  I get the error " 
>> 'ascii' codec can't decode" using the latest web2py download 
>> (2.10.4-stable+timestamp.2015.04.26.15.11.54 (Running on Apache/2.4.7 
>> (Ubuntu), Python 2.7.6)). This occurs even with “” characters in the 
>> on-board wiki.
>> Could you tell me the steps of the easiest way to fix this? (I don't mind 
>> which i use pg8000 or psycopg2) Is it a simple matter of 
>>
>> sudo apt-get install python-psycopg2
>>
>> ?
>>
>>
>> On Sunday, June 21, 2015 at 11:20:33 PM UTC-7, Paolo Valleri wrote:
>>>
>>> Massimo the mentioned issue has been fixed in pydal. Have you found 
>>> other different issues?
>>>
>>> Paolo
>>>
>>> On Sunday, June 21, 2015 at 6:14:29 PM UTC+2, Massimo Di Pierro wrote:

 I think we should remove pg8000 unless this unicode problem is fixed. 
 It just causes problem to new pgsql users. psycopg2 is solid.

 On Thursday, 18 June 2015 12:59:44 UTC-5, Paolo Valleri wrote:
>
> In general the best choice is psycopg2 however, the issue with pg8000 
> has been fixed
> I've written an initial basic unittest 
> https://github.com/web2py/pydal/blob/master/tests/base.py#L72 to 
> check possible issues with unicode
>
>
>  Paolo
>
> 2015-06-18 19:47 GMT+02:00 Antonio Salazar :
>
>> Is it still recommended to use psycopg2 instead of pg8000 after this 
>> fix?
>>
>> El lunes, 15 de junio de 2015, 5:28:09 (UTC-5), Paolo Valleri 
>> escribió:
>>
>>> According to my tests, the current PG adapter works only with 
>>> psycopg2 and python2.7
>>> It is broken with both pg8000 and psycopg2 on python 3.x
>>>
>>> A possible fix for pg8000 and python2.7 is here 
>>> https://github.com/ilvalle/pydal/commit/d5450938ae606a3e85deffa831899a35146f5e64
>>>
>>> I've posted an issue for psycopg2 with python3.x here 
>>> https://github.com/psycopg/psycopg2/issues/331#issuecomment-111909256
>>>
>>> Paolo
>>>
>>> On Saturday, June 13, 2015 at 5:22:07 AM UTC+2, Massimo Di Pierro 
>>> wrote:

 It is a bug in pg8000. You need to install psycopg2

 On Friday, 12 June 2015 13:51:55 UTC-5, Antonio Salazar wrote:
>
> I have the same problem. PostgreSQL database, web2py 
> 2.11.2-stable+timestamp.2015.05.30.16.33.24 
> source install.
>
> Now any field update which has non-ASCII characters fails with 
> " 'ascii' codec can't decode 
> byte 
> 0xc3 in position X: ordinal not in range(128)"
> By any field update, I mean custom forms, form grids, and even 
> database administration.
>
> This is the traceback after failing to change a user's name to 
> "José" with database administration:
>
> Traceback (most recent call last):
>   File "S:\Extranet\Website\Fuentes\web2py\gluon\restricted.py", line 
> 227, in restricted
> exec ccode in environment
>   File 
> "S:/Extranet/Website/Fuentes/web2py/applications/extranet/controllers/appadmin.py"
>  , 
> line 704, in 
>   File "S:\Extranet\Website\Fuentes\web2py\gluon\globals.py", line 
> 412, in 
> self._caller = lambda f: f()
>   File 
> "S:/Extranet/Website/Fuentes/web2py/applications/extranet/controllers/appadmin.py"
>  , 
> line 343, in update
> if form.accepts(request.vars, session):
>   File "S:\Extranet\Website\Fuentes\web2py\gluon\sqlhtml.py", line 
> 1686, in accepts
> self.id_field_name]).update(**fields)
>   File 
> "S:\Extranet\Website\Fuentes\web2py\gluon\packages\dal\pydal\objects.py",
>  line 2020, in update
> ret = db._adapter.update("%s" % 
> table._tablename,self.query,fields)
>   File 
> "S:\Extranet\Website\Fuentes\web2py\gluon\packages\dal\pydal\adapters\base.py",
>  line 996, in update
> raise e
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 
> 57: ordinal not in range(128)
>
>
> I don't recall having this problem with pre 2.10 versions
>
  -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>>>

Re: [web2py] Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1145: ordinal not in range(128)

2015-06-22 Thread Paolo Valleri
Hi Ben, the latest web2py download doesn't include the fix yet. You have to
either manually update pydal or wait for a newer release of web2py

 Paolo

2015-06-23 6:12 GMT+02:00 Ben Lawrence :

> Hi Paolo,  I get the error " 'ascii'
> codec can't decode" using the latest web2py download
> (2.10.4-stable+timestamp.2015.04.26.15.11.54 (Running on Apache/2.4.7
> (Ubuntu), Python 2.7.6)). This occurs even with “” characters in the
> on-board wiki.
> Could you tell me the steps of the easiest way to fix this? (I don't mind
> which i use pg8000 or psycopg2) Is it a simple matter of
>
> sudo apt-get install python-psycopg2
>
> ?
>
>
> On Sunday, June 21, 2015 at 11:20:33 PM UTC-7, Paolo Valleri wrote:
>>
>> Massimo the mentioned issue has been fixed in pydal. Have you found other
>> different issues?
>>
>> Paolo
>>
>> On Sunday, June 21, 2015 at 6:14:29 PM UTC+2, Massimo Di Pierro wrote:
>>>
>>> I think we should remove pg8000 unless this unicode problem is fixed. It
>>> just causes problem to new pgsql users. psycopg2 is solid.
>>>
>>> On Thursday, 18 June 2015 12:59:44 UTC-5, Paolo Valleri wrote:

 In general the best choice is psycopg2 however, the issue with pg8000
 has been fixed
 I've written an initial basic unittest
 https://github.com/web2py/pydal/blob/master/tests/base.py#L72 to check
 possible issues with unicode


  Paolo

 2015-06-18 19:47 GMT+02:00 Antonio Salazar :

> Is it still recommended to use psycopg2 instead of pg8000 after this
> fix?
>
> El lunes, 15 de junio de 2015, 5:28:09 (UTC-5), Paolo Valleri escribió:
>
>> According to my tests, the current PG adapter works only with
>> psycopg2 and python2.7
>> It is broken with both pg8000 and psycopg2 on python 3.x
>>
>> A possible fix for pg8000 and python2.7 is here
>> https://github.com/ilvalle/pydal/commit/d5450938ae606a3e85deffa831899a35146f5e64
>>
>> I've posted an issue for psycopg2 with python3.x here
>> https://github.com/psycopg/psycopg2/issues/331#issuecomment-111909256
>>
>> Paolo
>>
>> On Saturday, June 13, 2015 at 5:22:07 AM UTC+2, Massimo Di Pierro
>> wrote:
>>>
>>> It is a bug in pg8000. You need to install psycopg2
>>>
>>> On Friday, 12 June 2015 13:51:55 UTC-5, Antonio Salazar wrote:

 I have the same problem. PostgreSQL database, web2py 
 2.11.2-stable+timestamp.2015.05.30.16.33.24
 source install.

 Now any field update which has non-ASCII characters fails with
 " 'ascii' codec can't decode byte
 0xc3 in position X: ordinal not in range(128)"
 By any field update, I mean custom forms, form grids, and even
 database administration.

 This is the traceback after failing to change a user's name to
 "José" with database administration:

 Traceback (most recent call last):
   File "S:\Extranet\Website\Fuentes\web2py\gluon\restricted.py", line 
 227, in restricted
 exec ccode in environment
   File 
 "S:/Extranet/Website/Fuentes/web2py/applications/extranet/controllers/appadmin.py"
  , 
 line 704, in 
   File "S:\Extranet\Website\Fuentes\web2py\gluon\globals.py", line 
 412, in 
 self._caller = lambda f: f()
   File 
 "S:/Extranet/Website/Fuentes/web2py/applications/extranet/controllers/appadmin.py"
  , 
 line 343, in update
 if form.accepts(request.vars, session):
   File "S:\Extranet\Website\Fuentes\web2py\gluon\sqlhtml.py", line 
 1686, in accepts
 self.id_field_name]).update(**fields)
   File 
 "S:\Extranet\Website\Fuentes\web2py\gluon\packages\dal\pydal\objects.py",
  line 2020, in update
 ret = db._adapter.update("%s" % table._tablename,self.query,fields)
   File 
 "S:\Extranet\Website\Fuentes\web2py\gluon\packages\dal\pydal\adapters\base.py",
  line 996, in update
 raise e
 UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 
 57: ordinal not in range(128)


 I don't recall having this problem with pre 2.10 versions

>>>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/AE6NVmLPCwk/unsubscribe.
> To unsubscribe from this group and all its topics, send an email 

Re: [web2py] Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1145: ordinal not in range(128)

2015-06-22 Thread Ben Lawrence
Hi Paolo,  I get the error " 'ascii' 
codec can't decode" using the latest web2py download 
(2.10.4-stable+timestamp.2015.04.26.15.11.54 (Running on Apache/2.4.7 
(Ubuntu), Python 2.7.6)). This occurs even with “” characters in the 
on-board wiki.
Could you tell me the steps of the easiest way to fix this? (I don't mind 
which i use pg8000 or psycopg2) Is it a simple matter of 

sudo apt-get install python-psycopg2

?


On Sunday, June 21, 2015 at 11:20:33 PM UTC-7, Paolo Valleri wrote:
>
> Massimo the mentioned issue has been fixed in pydal. Have you found other 
> different issues?
>
> Paolo
>
> On Sunday, June 21, 2015 at 6:14:29 PM UTC+2, Massimo Di Pierro wrote:
>>
>> I think we should remove pg8000 unless this unicode problem is fixed. It 
>> just causes problem to new pgsql users. psycopg2 is solid.
>>
>> On Thursday, 18 June 2015 12:59:44 UTC-5, Paolo Valleri wrote:
>>>
>>> In general the best choice is psycopg2 however, the issue with pg8000 
>>> has been fixed
>>> I've written an initial basic unittest 
>>> https://github.com/web2py/pydal/blob/master/tests/base.py#L72 to check 
>>> possible issues with unicode
>>>
>>>
>>>  Paolo
>>>
>>> 2015-06-18 19:47 GMT+02:00 Antonio Salazar :
>>>
 Is it still recommended to use psycopg2 instead of pg8000 after this 
 fix?

 El lunes, 15 de junio de 2015, 5:28:09 (UTC-5), Paolo Valleri escribió:

> According to my tests, the current PG adapter works only with psycopg2 
> and python2.7
> It is broken with both pg8000 and psycopg2 on python 3.x
>
> A possible fix for pg8000 and python2.7 is here 
> https://github.com/ilvalle/pydal/commit/d5450938ae606a3e85deffa831899a35146f5e64
>
> I've posted an issue for psycopg2 with python3.x here 
> https://github.com/psycopg/psycopg2/issues/331#issuecomment-111909256
>
> Paolo
>
> On Saturday, June 13, 2015 at 5:22:07 AM UTC+2, Massimo Di Pierro 
> wrote:
>>
>> It is a bug in pg8000. You need to install psycopg2
>>
>> On Friday, 12 June 2015 13:51:55 UTC-5, Antonio Salazar wrote:
>>>
>>> I have the same problem. PostgreSQL database, web2py 
>>> 2.11.2-stable+timestamp.2015.05.30.16.33.24 
>>> source install.
>>>
>>> Now any field update which has non-ASCII characters fails with 
>>> " 'ascii' codec can't decode byte 
>>> 0xc3 in position X: ordinal not in range(128)"
>>> By any field update, I mean custom forms, form grids, and even 
>>> database administration.
>>>
>>> This is the traceback after failing to change a user's name to 
>>> "José" with database administration:
>>>
>>> Traceback (most recent call last):
>>>   File "S:\Extranet\Website\Fuentes\web2py\gluon\restricted.py", line 
>>> 227, in restricted
>>> exec ccode in environment
>>>   File 
>>> "S:/Extranet/Website/Fuentes/web2py/applications/extranet/controllers/appadmin.py"
>>>  , 
>>> line 704, in 
>>>   File "S:\Extranet\Website\Fuentes\web2py\gluon\globals.py", line 412, 
>>> in 
>>> self._caller = lambda f: f()
>>>   File 
>>> "S:/Extranet/Website/Fuentes/web2py/applications/extranet/controllers/appadmin.py"
>>>  , 
>>> line 343, in update
>>> if form.accepts(request.vars, session):
>>>   File "S:\Extranet\Website\Fuentes\web2py\gluon\sqlhtml.py", line 
>>> 1686, in accepts
>>> self.id_field_name]).update(**fields)
>>>   File 
>>> "S:\Extranet\Website\Fuentes\web2py\gluon\packages\dal\pydal\objects.py",
>>>  line 2020, in update
>>> ret = db._adapter.update("%s" % table._tablename,self.query,fields)
>>>   File 
>>> "S:\Extranet\Website\Fuentes\web2py\gluon\packages\dal\pydal\adapters\base.py",
>>>  line 996, in update
>>> raise e
>>> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 
>>> 57: ordinal not in range(128)
>>>
>>>
>>> I don't recall having this problem with pre 2.10 versions
>>>
>>  -- 
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 --- 
 You received this message because you are subscribed to a topic in the 
 Google Groups "web2py-users" group.
 To unsubscribe from this topic, visit 
 https://groups.google.com/d/topic/web2py/AE6NVmLPCwk/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to 
 web2py+un...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

>>>
>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report I

Re: [web2py] Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1145: ordinal not in range(128)

2015-06-21 Thread Massimo Di Pierro
Thanks for letting me know. I did not try that yet.

On Monday, 22 June 2015 01:20:33 UTC-5, Paolo Valleri wrote:
>
> Massimo the mentioned issue has been fixed in pydal. Have you found other 
> different issues?
>
> Paolo
>
> On Sunday, June 21, 2015 at 6:14:29 PM UTC+2, Massimo Di Pierro wrote:
>>
>> I think we should remove pg8000 unless this unicode problem is fixed. It 
>> just causes problem to new pgsql users. psycopg2 is solid.
>>
>> On Thursday, 18 June 2015 12:59:44 UTC-5, Paolo Valleri wrote:
>>>
>>> In general the best choice is psycopg2 however, the issue with pg8000 
>>> has been fixed
>>> I've written an initial basic unittest 
>>> https://github.com/web2py/pydal/blob/master/tests/base.py#L72 to check 
>>> possible issues with unicode
>>>
>>>
>>>  Paolo
>>>
>>> 2015-06-18 19:47 GMT+02:00 Antonio Salazar :
>>>
 Is it still recommended to use psycopg2 instead of pg8000 after this 
 fix?

 El lunes, 15 de junio de 2015, 5:28:09 (UTC-5), Paolo Valleri escribió:

> According to my tests, the current PG adapter works only with psycopg2 
> and python2.7
> It is broken with both pg8000 and psycopg2 on python 3.x
>
> A possible fix for pg8000 and python2.7 is here 
> https://github.com/ilvalle/pydal/commit/d5450938ae606a3e85deffa831899a35146f5e64
>
> I've posted an issue for psycopg2 with python3.x here 
> https://github.com/psycopg/psycopg2/issues/331#issuecomment-111909256
>
> Paolo
>
> On Saturday, June 13, 2015 at 5:22:07 AM UTC+2, Massimo Di Pierro 
> wrote:
>>
>> It is a bug in pg8000. You need to install psycopg2
>>
>> On Friday, 12 June 2015 13:51:55 UTC-5, Antonio Salazar wrote:
>>>
>>> I have the same problem. PostgreSQL database, web2py 
>>> 2.11.2-stable+timestamp.2015.05.30.16.33.24 
>>> source install.
>>>
>>> Now any field update which has non-ASCII characters fails with 
>>> " 'ascii' codec can't decode byte 
>>> 0xc3 in position X: ordinal not in range(128)"
>>> By any field update, I mean custom forms, form grids, and even 
>>> database administration.
>>>
>>> This is the traceback after failing to change a user's name to 
>>> "José" with database administration:
>>>
>>> Traceback (most recent call last):
>>>   File "S:\Extranet\Website\Fuentes\web2py\gluon\restricted.py", line 
>>> 227, in restricted
>>> exec ccode in environment
>>>   File 
>>> "S:/Extranet/Website/Fuentes/web2py/applications/extranet/controllers/appadmin.py"
>>>  , 
>>> line 704, in 
>>>   File "S:\Extranet\Website\Fuentes\web2py\gluon\globals.py", line 412, 
>>> in 
>>> self._caller = lambda f: f()
>>>   File 
>>> "S:/Extranet/Website/Fuentes/web2py/applications/extranet/controllers/appadmin.py"
>>>  , 
>>> line 343, in update
>>> if form.accepts(request.vars, session):
>>>   File "S:\Extranet\Website\Fuentes\web2py\gluon\sqlhtml.py", line 
>>> 1686, in accepts
>>> self.id_field_name]).update(**fields)
>>>   File 
>>> "S:\Extranet\Website\Fuentes\web2py\gluon\packages\dal\pydal\objects.py",
>>>  line 2020, in update
>>> ret = db._adapter.update("%s" % table._tablename,self.query,fields)
>>>   File 
>>> "S:\Extranet\Website\Fuentes\web2py\gluon\packages\dal\pydal\adapters\base.py",
>>>  line 996, in update
>>> raise e
>>> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 
>>> 57: ordinal not in range(128)
>>>
>>>
>>> I don't recall having this problem with pre 2.10 versions
>>>
>>  -- 
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 --- 
 You received this message because you are subscribed to a topic in the 
 Google Groups "web2py-users" group.
 To unsubscribe from this topic, visit 
 https://groups.google.com/d/topic/web2py/AE6NVmLPCwk/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to 
 web2py+un...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

>>>
>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1145: ordinal not in range(128)

2015-06-21 Thread Paolo Valleri
Massimo the mentioned issue has been fixed in pydal. Have you found other 
different issues?

Paolo

On Sunday, June 21, 2015 at 6:14:29 PM UTC+2, Massimo Di Pierro wrote:
>
> I think we should remove pg8000 unless this unicode problem is fixed. It 
> just causes problem to new pgsql users. psycopg2 is solid.
>
> On Thursday, 18 June 2015 12:59:44 UTC-5, Paolo Valleri wrote:
>>
>> In general the best choice is psycopg2 however, the issue with pg8000 has 
>> been fixed
>> I've written an initial basic unittest 
>> https://github.com/web2py/pydal/blob/master/tests/base.py#L72 to check 
>> possible issues with unicode
>>
>>
>>  Paolo
>>
>> 2015-06-18 19:47 GMT+02:00 Antonio Salazar > >:
>>
>>> Is it still recommended to use psycopg2 instead of pg8000 after this fix?
>>>
>>> El lunes, 15 de junio de 2015, 5:28:09 (UTC-5), Paolo Valleri escribió:
>>>
 According to my tests, the current PG adapter works only with psycopg2 
 and python2.7
 It is broken with both pg8000 and psycopg2 on python 3.x

 A possible fix for pg8000 and python2.7 is here 
 https://github.com/ilvalle/pydal/commit/d5450938ae606a3e85deffa831899a35146f5e64

 I've posted an issue for psycopg2 with python3.x here 
 https://github.com/psycopg/psycopg2/issues/331#issuecomment-111909256

 Paolo

 On Saturday, June 13, 2015 at 5:22:07 AM UTC+2, Massimo Di Pierro wrote:
>
> It is a bug in pg8000. You need to install psycopg2
>
> On Friday, 12 June 2015 13:51:55 UTC-5, Antonio Salazar wrote:
>>
>> I have the same problem. PostgreSQL database, web2py 
>> 2.11.2-stable+timestamp.2015.05.30.16.33.24 
>> source install.
>>
>> Now any field update which has non-ASCII characters fails with "> 'exceptions.UnicodeDecodeError'> 'ascii' codec can't decode byte 0xc3 in 
>> position X: ordinal not in range(128)"
>> By any field update, I mean custom forms, form grids, and even 
>> database administration.
>>
>> This is the traceback after failing to change a user's name to "José" 
>> with database administration:
>>
>> Traceback (most recent call last):
>>   File "S:\Extranet\Website\Fuentes\web2py\gluon\restricted.py", line 
>> 227, in restricted
>> exec ccode in environment
>>   File 
>> "S:/Extranet/Website/Fuentes/web2py/applications/extranet/controllers/appadmin.py"
>>  , 
>> line 704, in 
>>   File "S:\Extranet\Website\Fuentes\web2py\gluon\globals.py", line 412, 
>> in 
>> self._caller = lambda f: f()
>>   File 
>> "S:/Extranet/Website/Fuentes/web2py/applications/extranet/controllers/appadmin.py"
>>  , 
>> line 343, in update
>> if form.accepts(request.vars, session):
>>   File "S:\Extranet\Website\Fuentes\web2py\gluon\sqlhtml.py", line 1686, 
>> in accepts
>> self.id_field_name]).update(**fields)
>>   File 
>> "S:\Extranet\Website\Fuentes\web2py\gluon\packages\dal\pydal\objects.py",
>>  line 2020, in update
>> ret = db._adapter.update("%s" % table._tablename,self.query,fields)
>>   File 
>> "S:\Extranet\Website\Fuentes\web2py\gluon\packages\dal\pydal\adapters\base.py",
>>  line 996, in update
>> raise e
>> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 57: 
>> ordinal not in range(128)
>>
>>
>> I don't recall having this problem with pre 2.10 versions
>>
>  -- 
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> --- 
>>> You received this message because you are subscribed to a topic in the 
>>> Google Groups "web2py-users" group.
>>> To unsubscribe from this topic, visit 
>>> https://groups.google.com/d/topic/web2py/AE6NVmLPCwk/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to 
>>> web2py+un...@googlegroups.com .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1145: ordinal not in range(128)

2015-06-21 Thread Annet
+1

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1145: ordinal not in range(128)

2015-06-21 Thread 黄祥
+1

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1145: ordinal not in range(128)

2015-06-21 Thread Massimo Di Pierro
I think we should remove pg8000 unless this unicode problem is fixed. It 
just causes problem to new pgsql users. psycopg2 is solid.

On Thursday, 18 June 2015 12:59:44 UTC-5, Paolo Valleri wrote:
>
> In general the best choice is psycopg2 however, the issue with pg8000 has 
> been fixed
> I've written an initial basic unittest 
> https://github.com/web2py/pydal/blob/master/tests/base.py#L72 to check 
> possible issues with unicode
>
>
>  Paolo
>
> 2015-06-18 19:47 GMT+02:00 Antonio Salazar :
>
>> Is it still recommended to use psycopg2 instead of pg8000 after this fix?
>>
>> El lunes, 15 de junio de 2015, 5:28:09 (UTC-5), Paolo Valleri escribió:
>>
>>> According to my tests, the current PG adapter works only with psycopg2 
>>> and python2.7
>>> It is broken with both pg8000 and psycopg2 on python 3.x
>>>
>>> A possible fix for pg8000 and python2.7 is here 
>>> https://github.com/ilvalle/pydal/commit/d5450938ae606a3e85deffa831899a35146f5e64
>>>
>>> I've posted an issue for psycopg2 with python3.x here 
>>> https://github.com/psycopg/psycopg2/issues/331#issuecomment-111909256
>>>
>>> Paolo
>>>
>>> On Saturday, June 13, 2015 at 5:22:07 AM UTC+2, Massimo Di Pierro wrote:

 It is a bug in pg8000. You need to install psycopg2

 On Friday, 12 June 2015 13:51:55 UTC-5, Antonio Salazar wrote:
>
> I have the same problem. PostgreSQL database, web2py 
> 2.11.2-stable+timestamp.2015.05.30.16.33.24 
> source install.
>
> Now any field update which has non-ASCII characters fails with " 'exceptions.UnicodeDecodeError'> 'ascii' codec can't decode byte 0xc3 in 
> position X: ordinal not in range(128)"
> By any field update, I mean custom forms, form grids, and even 
> database administration.
>
> This is the traceback after failing to change a user's name to "José" 
> with database administration:
>
> Traceback (most recent call last):
>   File "S:\Extranet\Website\Fuentes\web2py\gluon\restricted.py", line 
> 227, in restricted
> exec ccode in environment
>   File 
> "S:/Extranet/Website/Fuentes/web2py/applications/extranet/controllers/appadmin.py"
>  , 
> line 704, in 
>   File "S:\Extranet\Website\Fuentes\web2py\gluon\globals.py", line 412, 
> in 
> self._caller = lambda f: f()
>   File 
> "S:/Extranet/Website/Fuentes/web2py/applications/extranet/controllers/appadmin.py"
>  , 
> line 343, in update
> if form.accepts(request.vars, session):
>   File "S:\Extranet\Website\Fuentes\web2py\gluon\sqlhtml.py", line 1686, 
> in accepts
> self.id_field_name]).update(**fields)
>   File 
> "S:\Extranet\Website\Fuentes\web2py\gluon\packages\dal\pydal\objects.py", 
> line 2020, in update
> ret = db._adapter.update("%s" % table._tablename,self.query,fields)
>   File 
> "S:\Extranet\Website\Fuentes\web2py\gluon\packages\dal\pydal\adapters\base.py",
>  line 996, in update
> raise e
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 57: 
> ordinal not in range(128)
>
>
> I don't recall having this problem with pre 2.10 versions
>
  -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/AE6NVmLPCwk/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1145: ordinal not in range(128)

2015-06-18 Thread Paolo Valleri
In general the best choice is psycopg2 however, the issue with pg8000 has
been fixed
I've written an initial basic unittest
https://github.com/web2py/pydal/blob/master/tests/base.py#L72 to check
possible issues with unicode


 Paolo

2015-06-18 19:47 GMT+02:00 Antonio Salazar :

> Is it still recommended to use psycopg2 instead of pg8000 after this fix?
>
> El lunes, 15 de junio de 2015, 5:28:09 (UTC-5), Paolo Valleri escribió:
>
>> According to my tests, the current PG adapter works only with psycopg2
>> and python2.7
>> It is broken with both pg8000 and psycopg2 on python 3.x
>>
>> A possible fix for pg8000 and python2.7 is here
>> https://github.com/ilvalle/pydal/commit/d5450938ae606a3e85deffa831899a35146f5e64
>>
>> I've posted an issue for psycopg2 with python3.x here
>> https://github.com/psycopg/psycopg2/issues/331#issuecomment-111909256
>>
>> Paolo
>>
>> On Saturday, June 13, 2015 at 5:22:07 AM UTC+2, Massimo Di Pierro wrote:
>>>
>>> It is a bug in pg8000. You need to install psycopg2
>>>
>>> On Friday, 12 June 2015 13:51:55 UTC-5, Antonio Salazar wrote:

 I have the same problem. PostgreSQL database, web2py 
 2.11.2-stable+timestamp.2015.05.30.16.33.24
 source install.

 Now any field update which has non-ASCII characters fails with ">>> 'exceptions.UnicodeDecodeError'> 'ascii' codec can't decode byte 0xc3 in
 position X: ordinal not in range(128)"
 By any field update, I mean custom forms, form grids, and even database
 administration.

 This is the traceback after failing to change a user's name to "José"
 with database administration:

 Traceback (most recent call last):
   File "S:\Extranet\Website\Fuentes\web2py\gluon\restricted.py", line 227, 
 in restricted
 exec ccode in environment
   File 
 "S:/Extranet/Website/Fuentes/web2py/applications/extranet/controllers/appadmin.py"
  , line 
 704, in 
   File "S:\Extranet\Website\Fuentes\web2py\gluon\globals.py", line 412, in 
 
 self._caller = lambda f: f()
   File 
 "S:/Extranet/Website/Fuentes/web2py/applications/extranet/controllers/appadmin.py"
  , line 
 343, in update
 if form.accepts(request.vars, session):
   File "S:\Extranet\Website\Fuentes\web2py\gluon\sqlhtml.py", line 1686, 
 in accepts
 self.id_field_name]).update(**fields)
   File 
 "S:\Extranet\Website\Fuentes\web2py\gluon\packages\dal\pydal\objects.py", 
 line 2020, in update
 ret = db._adapter.update("%s" % table._tablename,self.query,fields)
   File 
 "S:\Extranet\Website\Fuentes\web2py\gluon\packages\dal\pydal\adapters\base.py",
  line 996, in update
 raise e
 UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 57: 
 ordinal not in range(128)


 I don't recall having this problem with pre 2.10 versions

>>>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/AE6NVmLPCwk/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1145: ordinal not in range(128)

2015-06-18 Thread Antonio Salazar
Is it still recommended to use psycopg2 instead of pg8000 after this fix?

El lunes, 15 de junio de 2015, 5:28:09 (UTC-5), Paolo Valleri escribió:
>
> According to my tests, the current PG adapter works only with psycopg2 and 
> python2.7
> It is broken with both pg8000 and psycopg2 on python 3.x
>
> A possible fix for pg8000 and python2.7 is here 
> https://github.com/ilvalle/pydal/commit/d5450938ae606a3e85deffa831899a35146f5e64
>
> I've posted an issue for psycopg2 with python3.x here 
> https://github.com/psycopg/psycopg2/issues/331#issuecomment-111909256
>
> Paolo
>
> On Saturday, June 13, 2015 at 5:22:07 AM UTC+2, Massimo Di Pierro wrote:
>>
>> It is a bug in pg8000. You need to install psycopg2
>>
>> On Friday, 12 June 2015 13:51:55 UTC-5, Antonio Salazar wrote:
>>>
>>> I have the same problem. PostgreSQL database, web2py 
>>> 2.11.2-stable+timestamp.2015.05.30.16.33.24 
>>> source install.
>>>
>>> Now any field update which has non-ASCII characters fails with ">> 'exceptions.UnicodeDecodeError'> 'ascii' codec can't decode byte 0xc3 in 
>>> position X: ordinal not in range(128)"
>>> By any field update, I mean custom forms, form grids, and even database 
>>> administration.
>>>
>>> This is the traceback after failing to change a user's name to "José" 
>>> with database administration:
>>>
>>> Traceback (most recent call last):
>>>   File "S:\Extranet\Website\Fuentes\web2py\gluon\restricted.py", line 227, 
>>> in restricted
>>> exec ccode in environment
>>>   File 
>>> "S:/Extranet/Website/Fuentes/web2py/applications/extranet/controllers/appadmin.py"
>>>  , line 
>>> 704, in 
>>>   File "S:\Extranet\Website\Fuentes\web2py\gluon\globals.py", line 412, in 
>>> 
>>> self._caller = lambda f: f()
>>>   File 
>>> "S:/Extranet/Website/Fuentes/web2py/applications/extranet/controllers/appadmin.py"
>>>  , line 
>>> 343, in update
>>> if form.accepts(request.vars, session):
>>>   File "S:\Extranet\Website\Fuentes\web2py\gluon\sqlhtml.py", line 1686, in 
>>> accepts
>>> self.id_field_name]).update(**fields)
>>>   File 
>>> "S:\Extranet\Website\Fuentes\web2py\gluon\packages\dal\pydal\objects.py", 
>>> line 2020, in update
>>> ret = db._adapter.update("%s" % table._tablename,self.query,fields)
>>>   File 
>>> "S:\Extranet\Website\Fuentes\web2py\gluon\packages\dal\pydal\adapters\base.py",
>>>  line 996, in update
>>> raise e
>>> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 57: 
>>> ordinal not in range(128)
>>>
>>>
>>> I don't recall having this problem with pre 2.10 versions
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1145: ordinal not in range(128)

2015-06-18 Thread Antonio Salazar
Is it still preferable to use psycopg2 instead of pg8000 after this fix?

El lunes, 15 de junio de 2015, 5:28:09 (UTC-5), Paolo Valleri escribió:
>
> According to my tests, the current PG adapter works only with psycopg2 and 
> python2.7
> It is broken with both pg8000 and psycopg2 on python 3.x
>
> A possible fix for pg8000 and python2.7 is here 
> https://github.com/ilvalle/pydal/commit/d5450938ae606a3e85deffa831899a35146f5e64
>
> I've posted an issue for psycopg2 with python3.x here 
> https://github.com/psycopg/psycopg2/issues/331#issuecomment-111909256
>
> Paolo
>
> On Saturday, June 13, 2015 at 5:22:07 AM UTC+2, Massimo Di Pierro wrote:
>>
>> It is a bug in pg8000. You need to install psycopg2
>>
>> On Friday, 12 June 2015 13:51:55 UTC-5, Antonio Salazar wrote:
>>>
>>> I have the same problem. PostgreSQL database, web2py 
>>> 2.11.2-stable+timestamp.2015.05.30.16.33.24 
>>> source install.
>>>
>>> Now any field update which has non-ASCII characters fails with ">> 'exceptions.UnicodeDecodeError'> 'ascii' codec can't decode byte 0xc3 in 
>>> position X: ordinal not in range(128)"
>>> By any field update, I mean custom forms, form grids, and even database 
>>> administration.
>>>
>>> This is the traceback after failing to change a user's name to "José" 
>>> with database administration:
>>>
>>> Traceback (most recent call last):
>>>   File "S:\Extranet\Website\Fuentes\web2py\gluon\restricted.py", line 227, 
>>> in restricted
>>> exec ccode in environment
>>>   File 
>>> "S:/Extranet/Website/Fuentes/web2py/applications/extranet/controllers/appadmin.py"
>>>  , line 
>>> 704, in 
>>>   File "S:\Extranet\Website\Fuentes\web2py\gluon\globals.py", line 412, in 
>>> 
>>> self._caller = lambda f: f()
>>>   File 
>>> "S:/Extranet/Website/Fuentes/web2py/applications/extranet/controllers/appadmin.py"
>>>  , line 
>>> 343, in update
>>> if form.accepts(request.vars, session):
>>>   File "S:\Extranet\Website\Fuentes\web2py\gluon\sqlhtml.py", line 1686, in 
>>> accepts
>>> self.id_field_name]).update(**fields)
>>>   File 
>>> "S:\Extranet\Website\Fuentes\web2py\gluon\packages\dal\pydal\objects.py", 
>>> line 2020, in update
>>> ret = db._adapter.update("%s" % table._tablename,self.query,fields)
>>>   File 
>>> "S:\Extranet\Website\Fuentes\web2py\gluon\packages\dal\pydal\adapters\base.py",
>>>  line 996, in update
>>> raise e
>>> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 57: 
>>> ordinal not in range(128)
>>>
>>>
>>> I don't recall having this problem with pre 2.10 versions
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1145: ordinal not in range(128)

2015-06-15 Thread Paolo Valleri
According to my tests, the current PG adapter works only with psycopg2 and 
python2.7
It is broken with both pg8000 and psycopg2 on python 3.x

A possible fix for pg8000 and python2.7 is 
here 
https://github.com/ilvalle/pydal/commit/d5450938ae606a3e85deffa831899a35146f5e64

I've posted an issue for psycopg2 with python3.x 
here https://github.com/psycopg/psycopg2/issues/331#issuecomment-111909256

Paolo

On Saturday, June 13, 2015 at 5:22:07 AM UTC+2, Massimo Di Pierro wrote:
>
> It is a bug in pg8000. You need to install psycopg2
>
> On Friday, 12 June 2015 13:51:55 UTC-5, Antonio Salazar wrote:
>>
>> I have the same problem. PostgreSQL database, web2py 
>> 2.11.2-stable+timestamp.2015.05.30.16.33.24 
>> source install.
>>
>> Now any field update which has non-ASCII characters fails with "> 'exceptions.UnicodeDecodeError'> 'ascii' codec can't decode byte 0xc3 in 
>> position X: ordinal not in range(128)"
>> By any field update, I mean custom forms, form grids, and even database 
>> administration.
>>
>> This is the traceback after failing to change a user's name to "José" 
>> with database administration:
>>
>> Traceback (most recent call last):
>>   File "S:\Extranet\Website\Fuentes\web2py\gluon\restricted.py", line 227, 
>> in restricted
>> exec ccode in environment
>>   File 
>> "S:/Extranet/Website/Fuentes/web2py/applications/extranet/controllers/appadmin.py"
>>  , line 
>> 704, in 
>>   File "S:\Extranet\Website\Fuentes\web2py\gluon\globals.py", line 412, in 
>> 
>> self._caller = lambda f: f()
>>   File 
>> "S:/Extranet/Website/Fuentes/web2py/applications/extranet/controllers/appadmin.py"
>>  , line 
>> 343, in update
>> if form.accepts(request.vars, session):
>>   File "S:\Extranet\Website\Fuentes\web2py\gluon\sqlhtml.py", line 1686, in 
>> accepts
>> self.id_field_name]).update(**fields)
>>   File 
>> "S:\Extranet\Website\Fuentes\web2py\gluon\packages\dal\pydal\objects.py", 
>> line 2020, in update
>> ret = db._adapter.update("%s" % table._tablename,self.query,fields)
>>   File 
>> "S:\Extranet\Website\Fuentes\web2py\gluon\packages\dal\pydal\adapters\base.py",
>>  line 996, in update
>> raise e
>> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 57: 
>> ordinal not in range(128)
>>
>>
>> I don't recall having this problem with pre 2.10 versions
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1145: ordinal not in range(128)

2015-06-12 Thread Massimo Di Pierro
It is a bug in pg8000. You need to install psycopg2

On Friday, 12 June 2015 13:51:55 UTC-5, Antonio Salazar wrote:
>
> I have the same problem. PostgreSQL database, web2py 
> 2.11.2-stable+timestamp.2015.05.30.16.33.24 
> source install.
>
> Now any field update which has non-ASCII characters fails with " 'exceptions.UnicodeDecodeError'> 'ascii' codec can't decode byte 0xc3 in 
> position X: ordinal not in range(128)"
> By any field update, I mean custom forms, form grids, and even database 
> administration.
>
> This is the traceback after failing to change a user's name to "José" with 
> database administration:
>
> Traceback (most recent call last):
>   File "S:\Extranet\Website\Fuentes\web2py\gluon\restricted.py", line 227, in 
> restricted
> exec ccode in environment
>   File 
> "S:/Extranet/Website/Fuentes/web2py/applications/extranet/controllers/appadmin.py"
>  , line 
> 704, in 
>   File "S:\Extranet\Website\Fuentes\web2py\gluon\globals.py", line 412, in 
> 
> self._caller = lambda f: f()
>   File 
> "S:/Extranet/Website/Fuentes/web2py/applications/extranet/controllers/appadmin.py"
>  , line 
> 343, in update
> if form.accepts(request.vars, session):
>   File "S:\Extranet\Website\Fuentes\web2py\gluon\sqlhtml.py", line 1686, in 
> accepts
> self.id_field_name]).update(**fields)
>   File 
> "S:\Extranet\Website\Fuentes\web2py\gluon\packages\dal\pydal\objects.py", 
> line 2020, in update
> ret = db._adapter.update("%s" % table._tablename,self.query,fields)
>   File 
> "S:\Extranet\Website\Fuentes\web2py\gluon\packages\dal\pydal\adapters\base.py",
>  line 996, in update
> raise e
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 57: 
> ordinal not in range(128)
>
>
> I don't recall having this problem with pre 2.10 versions
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1145: ordinal not in range(128)

2015-06-12 Thread Antonio Salazar
I have the same problem. PostgreSQL database, web2py 
2.11.2-stable+timestamp.2015.05.30.16.33.24 
source install.

Now any field update which has non-ASCII characters fails with " 'ascii' codec can't decode byte 0xc3 in 
position X: ordinal not in range(128)"
By any field update, I mean custom forms, form grids, and even database 
administration.

This is the traceback after failing to change a user's name to "José" with 
database administration:

Traceback (most recent call last):
  File "S:\Extranet\Website\Fuentes\web2py\gluon\restricted.py", line 227, in 
restricted
exec ccode in environment
  File 
"S:/Extranet/Website/Fuentes/web2py/applications/extranet/controllers/appadmin.py"
 , line 704, 
in 
  File "S:\Extranet\Website\Fuentes\web2py\gluon\globals.py", line 412, in 

self._caller = lambda f: f()
  File 
"S:/Extranet/Website/Fuentes/web2py/applications/extranet/controllers/appadmin.py"
 , line 343, 
in update
if form.accepts(request.vars, session):
  File "S:\Extranet\Website\Fuentes\web2py\gluon\sqlhtml.py", line 1686, in 
accepts
self.id_field_name]).update(**fields)
  File 
"S:\Extranet\Website\Fuentes\web2py\gluon\packages\dal\pydal\objects.py", line 
2020, in update
ret = db._adapter.update("%s" % table._tablename,self.query,fields)
  File 
"S:\Extranet\Website\Fuentes\web2py\gluon\packages\dal\pydal\adapters\base.py", 
line 996, in update
raise e
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 57: 
ordinal not in range(128)


I don't recall having this problem with pre 2.10 versions

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1145: ordinal not in range(128)

2015-05-17 Thread Willoughby
The latest source is 2.10.4 so you could try that or if that fails, use 
2.9.11.

On Sunday, May 17, 2015 at 2:09:01 AM UTC-4, Annet wrote:
>
>
> Hmm...well, both your error and the issue you mention reference pydal, 
>> which is now a separate project and I believe has to be 'upgraded' 
>> separately as well.
>> Did you upgrade PyDAL?
>>
>
> No, I just downloaded the latest version of the source code for normal 
> users,
> unzipped it, and created a new simple application.
>
> Further more, I used appconfig.init to configure db, smpt and form 
> styling, and
> reused code from a previous application in db.py, a controller and some 
> views.
>
> I am not using GitHub, I am just using Web2py to develop a web application.
>
> Should I downgrade to version 2.9.11 to solve this issue?
>
>
> Kind regards,
>
> Annet
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1145: ordinal not in range(128)

2015-05-16 Thread Annet


> Hmm...well, both your error and the issue you mention reference pydal, 
> which is now a separate project and I believe has to be 'upgraded' 
> separately as well.
> Did you upgrade PyDAL?
>

No, I just downloaded the latest version of the source code for normal 
users,
unzipped it, and created a new simple application.

Further more, I used appconfig.init to configure db, smpt and form styling, 
and
reused code from a previous application in db.py, a controller and some 
views.

I am not using GitHub, I am just using Web2py to develop a web application.

Should I downgrade to version 2.9.11 to solve this issue?


Kind regards,

Annet

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1145: ordinal not in range(128)

2015-05-16 Thread Willoughby
Hmm...well, both your error and the issue you mention reference pydal, 
which is now a separate project and I believe has to be 'upgraded' 
separately as well.
Did you upgrade PyDAL?

PyDAL--The DAL is now an independent project 




On Saturday, May 16, 2015 at 2:34:31 AM UTC-4, Annet wrote:
>
> Hi,
>
> Thanks for you reply, I read the post before posting my question,
> I also read this post: https://github.com/web2py/web2py/issues/910
>
> My problem is that I wasn't having this issue in:
>
> Version 2.9.11-stable+timestamp.2014.09.15.23.35.11
> Database drivers available: SQLite(sqlite3), MySQL(pymysql), 
> PostgreSQL(pg8000), 
> MSSQL(pyodbc), DB2(pyodbc), Teradata(pyodbc), Ingres(pyodbc), IMAP(imaplib)
>
> which as far as I can see also only has pg8000 available not psycopg2
>
> Created by Massimo Di Pierro, Copyright 2007-2015
> Version 2.10.3-stable+timestamp.2015.04.02.21.42.07
> Database drivers available: sqlite3, imaplib, pyodbc, pymysql, pg8000
>
> I prefer to keep my web2py installation as close to when its first 
> unzipped,
> this makes in easier to host it.
>
>
> Kind regards,
>
> Annet
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1145: ordinal not in range(128)

2015-05-15 Thread Annet
Hi,

Thanks for you reply, I read the post before posting my question,
I also read this post: https://github.com/web2py/web2py/issues/910

My problem is that I wasn't having this issue in:

Version 2.9.11-stable+timestamp.2014.09.15.23.35.11
Database drivers available: SQLite(sqlite3), MySQL(pymysql), 
PostgreSQL(pg8000), 
MSSQL(pyodbc), DB2(pyodbc), Teradata(pyodbc), Ingres(pyodbc), IMAP(imaplib)

which as far as I can see also only has pg8000 available not psycopg2

Created by Massimo Di Pierro, Copyright 2007-2015
Version 2.10.3-stable+timestamp.2015.04.02.21.42.07
Database drivers available: sqlite3, imaplib, pyodbc, pymysql, pg8000

I prefer to keep my web2py installation as close to when its first unzipped,
this makes in easier to host it.


Kind regards,

Annet

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1145: ordinal not in range(128)

2015-05-15 Thread Willoughby
Postgre?
https://groups.google.com/d/topic/web2py/LJwG9ec4o28/discussion


On Friday, May 15, 2015 at 12:15:16 PM UTC-4, Annet wrote:
>
> After upgrading to web2py version 2.10.3 I get an error on fields
> of type text when they contain accented latin characters, see
> traceback.
>
>
> Traceback (most recent call last):
>   File "/Users/iannet/web2py_local/gluon/restricted.py", line 227, in 
> restricted
> exec ccode in environment
>   File 
> "/Users/iannet/web2py_local/applications/my/controllers/landingpage.py", 
> line 131, in 
>   File "/Users/iannet/web2py_local/gluon/globals.py", line 393, in 
> self._caller = lambda f: f()
>   File "/Users/iannet/web2py_local/gluon/tools.py", line 3440, in f
> return action(*a, **b)
>   File "/Users/iannet/web2py_local/gluon/tools.py", line 3440, in f
> return action(*a, **b)
>   File 
> "/Users/iannet/web2py_local/applications/my/controllers/landingpage.py", 
> line 116, in landingpage_form
> if form.process().accepted:
>   File "/Users/iannet/web2py_local/gluon/html.py", line 2301, in process
> self.validate(**kwargs)
>   File "/Users/iannet/web2py_local/gluon/html.py", line 2238, in validate
> if self.accepts(**kwargs):
>   File "/Users/iannet/web2py_local/gluon/sqlhtml.py", line 1677, in accepts
> self.id_field_name]).update(**fields)
>   File "/Users/iannet/web2py_local/gluon/packages/dal/pydal/objects.py", 
> line 2117, in update
> ret = db._adapter.update("%s" % table._tablename,self.query,fields)
>   File 
> "/Users/iannet/web2py_local/gluon/packages/dal/pydal/adapters/base.py", 
> line 988, in update
> raise e
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1145: 
> ordinal not in range(128)
>
>
> Why isn't my application backward compatible?
>
> Kind regards,
>
> Annet
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: "UnicodeDecodeError: 'ascii' codec can't decode byte ...

2010-11-10 Thread Omri
I should have thought about that.. the result from the print data function
is:

{u'textfield': u'Viele Umlauts:
\xe4\xe4\xe4\xfc\xfc\xfc\xdc\xdc\xdc\xd6\xd6\xd6\xe4\xe4\xe4', u'name':
u'\xdcberprufen'}

for the following data sent:
data = {
  name : "Überprufen",
  textfield : "Viele Umlauts: äääüüüÜÜÜÖÖÖäää"
}

On Wed, Nov 10, 2010 at 15:23, mdipierro  wrote:

> If you start web2py from the console you should see the output to the
> console. You can also print to a file or log the output if that makes
> it easier.
>
> On Nov 10, 5:47 am, Omri  wrote:
> > sorry for the stupid question - but how can I call the "print data"
> function
> > inside a function that is called through JSONRPC? where will I see the
> > output?
> > in case it helps - I know that at least I get the two fields that I sent,
> > because the last line (where I name them specifically) works.
> >
> > On Tue, Nov 9, 2010 at 21:01, mdipierro  wrote:
> > > As a debug check. I'd like to see what you gate if you "print data"
> > > before the update.
> > > Just in case what you put it in it is not what you get.
> >
> > > On Nov 9, 1:25 pm, Omri  wrote:
> > > > in the qooxdoo application, I define data as
> > > > data = {name: "Prüfung", textfield : "Etwas mit umlaut- üäüöö"}
> > > > and then send it through an asynchronous call (using
> > > > qx.io.remote.Rpc.callAsync)
> >
> > > > On Tue, Nov 9, 2010 at 19:42, mdipierro 
> wrote:
> > > > > can you print data? What is in data?
> >
> > > > > On Nov 9, 12:20 pm, Omri  wrote:
> > > > > > I did some tryouts and it seems that the only problem is with the
> > > > > > update method, and then only when called through service.jsonrpc.
> I
> > > > > > created the following model:
> >
> > > > > > db.define_table("debug_stuff",
> > > > > > Field("name", length=100),
> > > > > > Field("textfield", "text"),
> > > > > > format="%(name)s")
> >
> > > > > > and defined the following function in the controller (default):
> >
> > > > > > @service.jsonrpc
> > > > > > def debug_umlauts(data):
> > > > > > # db["debug_stuff"].insert(**data)  #  <--- Worked, no
> > > problem
> > > > > > # db(db["debug_stuff"]["id"] == 2).update(**data)   #
> <---
> > > Didn't
> > > > > > work
> > > > > > db(db["debug_stuff"]["id"] == 2).update(name =
> data['name'],
> > > > > > textfield=data['textfield'])  # <--- Worked
> > > > > > return "OK update"
> >
> > > > > > The only line that didn't work was the second one, where I tried
> to
> > > > > > use the **data for the update method. The problem is that I want
> the
> > > > > > method to be general, and therefore cannot use the method of the
> > > third
> > > > > > line to specify for .update what fields I'm updating.
> >
> > > > > > Thanks,
> > > > > > Omri
> >
> > > > > > On Nov 8, 5:19 pm, mdipierro  wrote:
> >
> > > > > > > Can you try put a u in front of the string u"..."
> >
> > > > > > > On Nov 8, 5:30 am, Omri  wrote:
> >
> > > > > > > > Hello,
> >
> > > > > > > > I'm having a unicode problem with the DAL.
> >
> > > > > > > > I'm developing a (mainly) RPC database application with
> qooxdoo
> > > as JS
> > > > > > > > framework and web2py as the webserver.
> >
> > > > > > > > I have created a fairly generic update_record function which
> > > simply
> > > > > > > > gets two input variables - a table name and a data dictionary
> > > with
> > > > > > > > name/value pairs which correspond to the fields of the table.
> > > > > > > > My function looks like this:
> >
> > > > > > > > def update_record(table_name, data):
> > > > > > > > db(db[table_name]['id'] == data['id']).update(**data)
> > > > > > > > return db(db[table_name]['id'] ==
> data['id']).select()
> >
> > > > > > > > My application should work both in English and in German, and
> my
> > > > > > > > problem is that when I try to update a string value with an
> > > Umlaut
> > > > > > > > (example - "Überwlad") I get an error:
> > > > > > > > "UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in
> > > > > > > > position..."
> >
> > > > > > > > I am able to insert records to the database with Umlauts, but
> I
> > > use a
> > > > > > > > different method for the insert. I use the syntax of
> .insert(name
> > > =
> > > > > > > > value, name2 = value2,...).
> >
> > > > > > > > I tried to encode all the data keys which are unicode objects
> > > without
> > > > > > > > success, it keeps raising the same error.
> >
> > > > > > > > Am I missing something here, or is this a bug? And more
> > > > > interestingly,
> > > > > > > > how can it be solved?
> >
> > > > > > > > Thanks,
> > > > > > > > Omri
> >
> >
>


[web2py] Re: "UnicodeDecodeError: 'ascii' codec can't decode byte ...

2010-11-10 Thread mdipierro
If you start web2py from the console you should see the output to the
console. You can also print to a file or log the output if that makes
it easier.

On Nov 10, 5:47 am, Omri  wrote:
> sorry for the stupid question - but how can I call the "print data" function
> inside a function that is called through JSONRPC? where will I see the
> output?
> in case it helps - I know that at least I get the two fields that I sent,
> because the last line (where I name them specifically) works.
>
> On Tue, Nov 9, 2010 at 21:01, mdipierro  wrote:
> > As a debug check. I'd like to see what you gate if you "print data"
> > before the update.
> > Just in case what you put it in it is not what you get.
>
> > On Nov 9, 1:25 pm, Omri  wrote:
> > > in the qooxdoo application, I define data as
> > > data = {name: "Prüfung", textfield : "Etwas mit umlaut- üäüöö"}
> > > and then send it through an asynchronous call (using
> > > qx.io.remote.Rpc.callAsync)
>
> > > On Tue, Nov 9, 2010 at 19:42, mdipierro  wrote:
> > > > can you print data? What is in data?
>
> > > > On Nov 9, 12:20 pm, Omri  wrote:
> > > > > I did some tryouts and it seems that the only problem is with the
> > > > > update method, and then only when called through service.jsonrpc. I
> > > > > created the following model:
>
> > > > > db.define_table("debug_stuff",
> > > > >         Field("name", length=100),
> > > > >         Field("textfield", "text"),
> > > > >         format="%(name)s")
>
> > > > > and defined the following function in the controller (default):
>
> > > > > @service.jsonrpc
> > > > > def debug_umlauts(data):
> > > > >         # db["debug_stuff"].insert(**data)  #  <--- Worked, no
> > problem
> > > > >         # db(db["debug_stuff"]["id"] == 2).update(**data)   # <---
> > Didn't
> > > > > work
> > > > >         db(db["debug_stuff"]["id"] == 2).update(name = data['name'],
> > > > > textfield=data['textfield'])  # <--- Worked
> > > > >         return "OK update"
>
> > > > > The only line that didn't work was the second one, where I tried to
> > > > > use the **data for the update method. The problem is that I want the
> > > > > method to be general, and therefore cannot use the method of the
> > third
> > > > > line to specify for .update what fields I'm updating.
>
> > > > > Thanks,
> > > > > Omri
>
> > > > > On Nov 8, 5:19 pm, mdipierro  wrote:
>
> > > > > > Can you try put a u in front of the string u"..."
>
> > > > > > On Nov 8, 5:30 am, Omri  wrote:
>
> > > > > > > Hello,
>
> > > > > > > I'm having a unicode problem with the DAL.
>
> > > > > > > I'm developing a (mainly) RPC database application with qooxdoo
> > as JS
> > > > > > > framework and web2py as the webserver.
>
> > > > > > > I have created a fairly generic update_record function which
> > simply
> > > > > > > gets two input variables - a table name and a data dictionary
> > with
> > > > > > > name/value pairs which correspond to the fields of the table.
> > > > > > > My function looks like this:
>
> > > > > > > def update_record(table_name, data):
> > > > > > >         db(db[table_name]['id'] == data['id']).update(**data)
> > > > > > >         return db(db[table_name]['id'] == data['id']).select()
>
> > > > > > > My application should work both in English and in German, and my
> > > > > > > problem is that when I try to update a string value with an
> > Umlaut
> > > > > > > (example - "Überwlad") I get an error:
> > > > > > > "UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in
> > > > > > > position..."
>
> > > > > > > I am able to insert records to the database with Umlauts, but I
> > use a
> > > > > > > different method for the insert. I use the syntax of .insert(name
> > =
> > > > > > > value, name2 = value2,...).
>
> > > > > > > I tried to encode all the data keys which are unicode objects
> > without
> > > > > > > success, it keeps raising the same error.
>
> > > > > > > Am I missing something here, or is this a bug? And more
> > > > interestingly,
> > > > > > > how can it be solved?
>
> > > > > > > Thanks,
> > > > > > > Omri
>
>


Re: [web2py] Re: "UnicodeDecodeError: 'ascii' codec can't decode byte ...

2010-11-10 Thread Omri
sorry for the stupid question - but how can I call the "print data" function
inside a function that is called through JSONRPC? where will I see the
output?
in case it helps - I know that at least I get the two fields that I sent,
because the last line (where I name them specifically) works.

On Tue, Nov 9, 2010 at 21:01, mdipierro  wrote:

> As a debug check. I'd like to see what you gate if you "print data"
> before the update.
> Just in case what you put it in it is not what you get.
>
> On Nov 9, 1:25 pm, Omri  wrote:
> > in the qooxdoo application, I define data as
> > data = {name: "Prüfung", textfield : "Etwas mit umlaut- üäüöö"}
> > and then send it through an asynchronous call (using
> > qx.io.remote.Rpc.callAsync)
> >
> > On Tue, Nov 9, 2010 at 19:42, mdipierro  wrote:
> > > can you print data? What is in data?
> >
> > > On Nov 9, 12:20 pm, Omri  wrote:
> > > > I did some tryouts and it seems that the only problem is with the
> > > > update method, and then only when called through service.jsonrpc. I
> > > > created the following model:
> >
> > > > db.define_table("debug_stuff",
> > > > Field("name", length=100),
> > > > Field("textfield", "text"),
> > > > format="%(name)s")
> >
> > > > and defined the following function in the controller (default):
> >
> > > > @service.jsonrpc
> > > > def debug_umlauts(data):
> > > > # db["debug_stuff"].insert(**data)  #  <--- Worked, no
> problem
> > > > # db(db["debug_stuff"]["id"] == 2).update(**data)   # <---
> Didn't
> > > > work
> > > > db(db["debug_stuff"]["id"] == 2).update(name = data['name'],
> > > > textfield=data['textfield'])  # <--- Worked
> > > > return "OK update"
> >
> > > > The only line that didn't work was the second one, where I tried to
> > > > use the **data for the update method. The problem is that I want the
> > > > method to be general, and therefore cannot use the method of the
> third
> > > > line to specify for .update what fields I'm updating.
> >
> > > > Thanks,
> > > > Omri
> >
> > > > On Nov 8, 5:19 pm, mdipierro  wrote:
> >
> > > > > Can you try put a u in front of the string u"..."
> >
> > > > > On Nov 8, 5:30 am, Omri  wrote:
> >
> > > > > > Hello,
> >
> > > > > > I'm having a unicode problem with the DAL.
> >
> > > > > > I'm developing a (mainly) RPC database application with qooxdoo
> as JS
> > > > > > framework and web2py as the webserver.
> >
> > > > > > I have created a fairly generic update_record function which
> simply
> > > > > > gets two input variables - a table name and a data dictionary
> with
> > > > > > name/value pairs which correspond to the fields of the table.
> > > > > > My function looks like this:
> >
> > > > > > def update_record(table_name, data):
> > > > > > db(db[table_name]['id'] == data['id']).update(**data)
> > > > > > return db(db[table_name]['id'] == data['id']).select()
> >
> > > > > > My application should work both in English and in German, and my
> > > > > > problem is that when I try to update a string value with an
> Umlaut
> > > > > > (example - "Überwlad") I get an error:
> > > > > > "UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in
> > > > > > position..."
> >
> > > > > > I am able to insert records to the database with Umlauts, but I
> use a
> > > > > > different method for the insert. I use the syntax of .insert(name
> =
> > > > > > value, name2 = value2,...).
> >
> > > > > > I tried to encode all the data keys which are unicode objects
> without
> > > > > > success, it keeps raising the same error.
> >
> > > > > > Am I missing something here, or is this a bug? And more
> > > interestingly,
> > > > > > how can it be solved?
> >
> > > > > > Thanks,
> > > > > > Omri
> >
> >
>


[web2py] Re: "UnicodeDecodeError: 'ascii' codec can't decode byte ...

2010-11-09 Thread mdipierro
As a debug check. I'd like to see what you gate if you "print data"
before the update.
Just in case what you put it in it is not what you get.

On Nov 9, 1:25 pm, Omri  wrote:
> in the qooxdoo application, I define data as
> data = {name: "Prüfung", textfield : "Etwas mit umlaut- üäüöö"}
> and then send it through an asynchronous call (using
> qx.io.remote.Rpc.callAsync)
>
> On Tue, Nov 9, 2010 at 19:42, mdipierro  wrote:
> > can you print data? What is in data?
>
> > On Nov 9, 12:20 pm, Omri  wrote:
> > > I did some tryouts and it seems that the only problem is with the
> > > update method, and then only when called through service.jsonrpc. I
> > > created the following model:
>
> > > db.define_table("debug_stuff",
> > >         Field("name", length=100),
> > >         Field("textfield", "text"),
> > >         format="%(name)s")
>
> > > and defined the following function in the controller (default):
>
> > > @service.jsonrpc
> > > def debug_umlauts(data):
> > >         # db["debug_stuff"].insert(**data)  #  <--- Worked, no problem
> > >         # db(db["debug_stuff"]["id"] == 2).update(**data)   # <--- Didn't
> > > work
> > >         db(db["debug_stuff"]["id"] == 2).update(name = data['name'],
> > > textfield=data['textfield'])  # <--- Worked
> > >         return "OK update"
>
> > > The only line that didn't work was the second one, where I tried to
> > > use the **data for the update method. The problem is that I want the
> > > method to be general, and therefore cannot use the method of the third
> > > line to specify for .update what fields I'm updating.
>
> > > Thanks,
> > > Omri
>
> > > On Nov 8, 5:19 pm, mdipierro  wrote:
>
> > > > Can you try put a u in front of the string u"..."
>
> > > > On Nov 8, 5:30 am, Omri  wrote:
>
> > > > > Hello,
>
> > > > > I'm having a unicode problem with the DAL.
>
> > > > > I'm developing a (mainly) RPC database application with qooxdoo as JS
> > > > > framework and web2py as the webserver.
>
> > > > > I have created a fairly generic update_record function which simply
> > > > > gets two input variables - a table name and a data dictionary with
> > > > > name/value pairs which correspond to the fields of the table.
> > > > > My function looks like this:
>
> > > > > def update_record(table_name, data):
> > > > >         db(db[table_name]['id'] == data['id']).update(**data)
> > > > >         return db(db[table_name]['id'] == data['id']).select()
>
> > > > > My application should work both in English and in German, and my
> > > > > problem is that when I try to update a string value with an Umlaut
> > > > > (example - "Überwlad") I get an error:
> > > > > "UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in
> > > > > position..."
>
> > > > > I am able to insert records to the database with Umlauts, but I use a
> > > > > different method for the insert. I use the syntax of .insert(name =
> > > > > value, name2 = value2,...).
>
> > > > > I tried to encode all the data keys which are unicode objects without
> > > > > success, it keeps raising the same error.
>
> > > > > Am I missing something here, or is this a bug? And more
> > interestingly,
> > > > > how can it be solved?
>
> > > > > Thanks,
> > > > > Omri
>
>


Re: [web2py] Re: "UnicodeDecodeError: 'ascii' codec can't decode byte ...

2010-11-09 Thread Omri
in the qooxdoo application, I define data as
data = {name: "Prüfung", textfield : "Etwas mit umlaut- üäüöö"}
and then send it through an asynchronous call (using
qx.io.remote.Rpc.callAsync)



On Tue, Nov 9, 2010 at 19:42, mdipierro  wrote:

> can you print data? What is in data?
>
> On Nov 9, 12:20 pm, Omri  wrote:
> > I did some tryouts and it seems that the only problem is with the
> > update method, and then only when called through service.jsonrpc. I
> > created the following model:
> >
> > db.define_table("debug_stuff",
> > Field("name", length=100),
> > Field("textfield", "text"),
> > format="%(name)s")
> >
> > and defined the following function in the controller (default):
> >
> > @service.jsonrpc
> > def debug_umlauts(data):
> > # db["debug_stuff"].insert(**data)  #  <--- Worked, no problem
> > # db(db["debug_stuff"]["id"] == 2).update(**data)   # <--- Didn't
> > work
> > db(db["debug_stuff"]["id"] == 2).update(name = data['name'],
> > textfield=data['textfield'])  # <--- Worked
> > return "OK update"
> >
> > The only line that didn't work was the second one, where I tried to
> > use the **data for the update method. The problem is that I want the
> > method to be general, and therefore cannot use the method of the third
> > line to specify for .update what fields I'm updating.
> >
> > Thanks,
> > Omri
> >
> > On Nov 8, 5:19 pm, mdipierro  wrote:
> >
> > > Can you try put a u in front of the string u"..."
> >
> > > On Nov 8, 5:30 am, Omri  wrote:
> >
> > > > Hello,
> >
> > > > I'm having a unicode problem with the DAL.
> >
> > > > I'm developing a (mainly) RPC database application with qooxdoo as JS
> > > > framework and web2py as the webserver.
> >
> > > > I have created a fairly generic update_record function which simply
> > > > gets two input variables - a table name and a data dictionary with
> > > > name/value pairs which correspond to the fields of the table.
> > > > My function looks like this:
> >
> > > > def update_record(table_name, data):
> > > > db(db[table_name]['id'] == data['id']).update(**data)
> > > > return db(db[table_name]['id'] == data['id']).select()
> >
> > > > My application should work both in English and in German, and my
> > > > problem is that when I try to update a string value with an Umlaut
> > > > (example - "Überwlad") I get an error:
> > > > "UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in
> > > > position..."
> >
> > > > I am able to insert records to the database with Umlauts, but I use a
> > > > different method for the insert. I use the syntax of .insert(name =
> > > > value, name2 = value2,...).
> >
> > > > I tried to encode all the data keys which are unicode objects without
> > > > success, it keeps raising the same error.
> >
> > > > Am I missing something here, or is this a bug? And more
> interestingly,
> > > > how can it be solved?
> >
> > > > Thanks,
> > > > Omri
> >
> >
>


[web2py] Re: "UnicodeDecodeError: 'ascii' codec can't decode byte ...

2010-11-09 Thread mdipierro
can you print data? What is in data?

On Nov 9, 12:20 pm, Omri  wrote:
> I did some tryouts and it seems that the only problem is with the
> update method, and then only when called through service.jsonrpc. I
> created the following model:
>
> db.define_table("debug_stuff",
>         Field("name", length=100),
>         Field("textfield", "text"),
>         format="%(name)s")
>
> and defined the following function in the controller (default):
>
> @service.jsonrpc
> def debug_umlauts(data):
>         # db["debug_stuff"].insert(**data)  #  <--- Worked, no problem
>         # db(db["debug_stuff"]["id"] == 2).update(**data)   # <--- Didn't
> work
>         db(db["debug_stuff"]["id"] == 2).update(name = data['name'],
> textfield=data['textfield'])  # <--- Worked
>         return "OK update"
>
> The only line that didn't work was the second one, where I tried to
> use the **data for the update method. The problem is that I want the
> method to be general, and therefore cannot use the method of the third
> line to specify for .update what fields I'm updating.
>
> Thanks,
> Omri
>
> On Nov 8, 5:19 pm, mdipierro  wrote:
>
> > Can you try put a u in front of the string u"..."
>
> > On Nov 8, 5:30 am, Omri  wrote:
>
> > > Hello,
>
> > > I'm having a unicode problem with the DAL.
>
> > > I'm developing a (mainly) RPC database application with qooxdoo as JS
> > > framework and web2py as the webserver.
>
> > > I have created a fairly generic update_record function which simply
> > > gets two input variables - a table name and a data dictionary with
> > > name/value pairs which correspond to the fields of the table.
> > > My function looks like this:
>
> > > def update_record(table_name, data):
> > >         db(db[table_name]['id'] == data['id']).update(**data)
> > >         return db(db[table_name]['id'] == data['id']).select()
>
> > > My application should work both in English and in German, and my
> > > problem is that when I try to update a string value with an Umlaut
> > > (example - "Überwlad") I get an error:
> > > "UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in
> > > position..."
>
> > > I am able to insert records to the database with Umlauts, but I use a
> > > different method for the insert. I use the syntax of .insert(name =
> > > value, name2 = value2,...).
>
> > > I tried to encode all the data keys which are unicode objects without
> > > success, it keeps raising the same error.
>
> > > Am I missing something here, or is this a bug? And more interestingly,
> > > how can it be solved?
>
> > > Thanks,
> > > Omri
>
>


[web2py] Re: "UnicodeDecodeError: 'ascii' codec can't decode byte ...

2010-11-09 Thread Omri
I did some tryouts and it seems that the only problem is with the
update method, and then only when called through service.jsonrpc. I
created the following model:

db.define_table("debug_stuff",
Field("name", length=100),
Field("textfield", "text"),
format="%(name)s")

and defined the following function in the controller (default):

@service.jsonrpc
def debug_umlauts(data):
# db["debug_stuff"].insert(**data)  #  <--- Worked, no problem
# db(db["debug_stuff"]["id"] == 2).update(**data)   # <--- Didn't
work
db(db["debug_stuff"]["id"] == 2).update(name = data['name'],
textfield=data['textfield'])  # <--- Worked
return "OK update"

The only line that didn't work was the second one, where I tried to
use the **data for the update method. The problem is that I want the
method to be general, and therefore cannot use the method of the third
line to specify for .update what fields I'm updating.

Thanks,
Omri

On Nov 8, 5:19 pm, mdipierro  wrote:
> Can you try put a u in front of the string u"..."
>
> On Nov 8, 5:30 am, Omri  wrote:
>
> > Hello,
>
> > I'm having a unicode problem with the DAL.
>
> > I'm developing a (mainly) RPC database application with qooxdoo as JS
> > framework and web2py as the webserver.
>
> > I have created a fairly generic update_record function which simply
> > gets two input variables - a table name and a data dictionary with
> > name/value pairs which correspond to the fields of the table.
> > My function looks like this:
>
> > def update_record(table_name, data):
> >         db(db[table_name]['id'] == data['id']).update(**data)
> >         return db(db[table_name]['id'] == data['id']).select()
>
> > My application should work both in English and in German, and my
> > problem is that when I try to update a string value with an Umlaut
> > (example - "Überwlad") I get an error:
> > "UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in
> > position..."
>
> > I am able to insert records to the database with Umlauts, but I use a
> > different method for the insert. I use the syntax of .insert(name =
> > value, name2 = value2,...).
>
> > I tried to encode all the data keys which are unicode objects without
> > success, it keeps raising the same error.
>
> > Am I missing something here, or is this a bug? And more interestingly,
> > how can it be solved?
>
> > Thanks,
> > Omri
>
>


[web2py] Re: "UnicodeDecodeError: 'ascii' codec can't decode byte ...

2010-11-08 Thread mdipierro
Can you try put a u in front of the string u"..."

On Nov 8, 5:30 am, Omri  wrote:
> Hello,
>
> I'm having a unicode problem with the DAL.
>
> I'm developing a (mainly) RPC database application with qooxdoo as JS
> framework and web2py as the webserver.
>
> I have created a fairly generic update_record function which simply
> gets two input variables - a table name and a data dictionary with
> name/value pairs which correspond to the fields of the table.
> My function looks like this:
>
> def update_record(table_name, data):
>         db(db[table_name]['id'] == data['id']).update(**data)
>         return db(db[table_name]['id'] == data['id']).select()
>
> My application should work both in English and in German, and my
> problem is that when I try to update a string value with an Umlaut
> (example - "Überwlad") I get an error:
> "UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in
> position..."
>
> I am able to insert records to the database with Umlauts, but I use a
> different method for the insert. I use the syntax of .insert(name =
> value, name2 = value2,...).
>
> I tried to encode all the data keys which are unicode objects without
> success, it keeps raising the same error.
>
> Am I missing something here, or is this a bug? And more interestingly,
> how can it be solved?
>
> Thanks,
> Omri