Re: Unicode heisenbug whilst running a management command

2009-11-17 Thread Tom Evans
On Tue, Nov 17, 2009 at 7:35 PM, Karen Tracey wrote: > On Tue, Nov 17, 2009 at 1:12 PM, Tom Evans wrote: > >> This appears to be some sort of issue between the mysqldb and django's >> templating system. >> >> This code generates the UnicodeEncodeError as shown above, when the model >> is saved: >

Re: Unicode heisenbug whilst running a management command

2009-11-17 Thread Karen Tracey
On Tue, Nov 17, 2009 at 1:12 PM, Tom Evans wrote: > This appears to be some sort of issue between the mysqldb and django's > templating system. > > This code generates the UnicodeEncodeError as shown above, when the model > is saved: > > > from django.template import loader > content

Re: Unicode heisenbug whilst running a management command

2009-11-17 Thread Tom Evans
On Tue, Nov 17, 2009 at 3:14 PM, Tom Evans wrote: > Hi all > > I'm encountering a difficult to solve unicode problem whilst saving data to > the database. Worst of all, any attempt to reduce it to a simple test case, > or reproduce it in the console fail(!). This is on django 1.0. > > The process

Re: Unicode heisenbug whilst running a management command

2009-11-17 Thread Tom Evans
On Tue, Nov 17, 2009 at 3:34 PM, dfolland wrote: > I've dealt with this by manipulating the data with Python codecs. > > import codecs > > new_value= codecs.decode(current_value, 'utf-8', 'ignore') > > the default option is 'strict' which will raise a ValueError that > you've experienced, 'ignore

Re: Unicode heisenbug whilst running a management command

2009-11-17 Thread dfolland
I've dealt with this by manipulating the data with Python codecs. import codecs new_value= codecs.decode(current_value, 'utf-8', 'ignore') the default option is 'strict' which will raise a ValueError that you've experienced, 'ignore' will drop the offending character, and 'replace' allows you to

Unicode heisenbug whilst running a management command

2009-11-17 Thread Tom Evans
Hi all I'm encountering a difficult to solve unicode problem whilst saving data to the database. Worst of all, any attempt to reduce it to a simple test case, or reproduce it in the console fail(!). This is on django 1.0. The process encountering the error is a simple daemon, run from a managemen