I change one thing at a time when debugging but after posting here, I
go on with experimenting. And when I respond to a request, like
posting the traceback, usually it is not the very exact instance that
I am running currently. I change it to be consistent with the on going
discussion, but sometimes there are some portions that are not
matched. But they have the same nature of problem.

In our case, the message and the subject have the same problem and
generated almost identical tracebacks, when instance.name contains non-
ascii chars.

And here is my Tag model:

class Tag(models.Model):
    name = models.CharField(max_length=50,
                            db_index=True,
                            validator_list=[isTag])
    slug = models.SlugField(editable = False,
                            unique = True)
    ignore = models.BooleanField(default=False)
    synonym_for = models.ForeignKey('self', blank=True, null=True)

    objects = TagManager()

    def save(self):
        self.slug = slugify(self.name)
        super(Tag, self).save()

    def __unicode__(self):
        name = self.name
        if self.ignore:
            name = u'%s (x)' % (name)
        if self.synonym_for:
            name = u'%s => %s' % (name, self.synonym_for.name)
        return name


Thanks...


On 4 Kasım, 02:26, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Sat, 2007-11-03 at 13:13 +0000, omat wrote:
> > Here is the traceback:
>
> > Traceback (most recent call last):
> >   File "update_feeds.py", line 171, in process_feed
> >     process_entry(entry, fpf, feed, postdict)
> >   File "update_feeds.py", line 119, in process_entry
> >     feed.tags))
> >   File "/srv/django/common/tagging/managers.py", line 39, in
> > update_tags
> >     tag = self.create(name = tag_name, slug = tag_slug)
> >   File "/usr/local/lib/python2.5/site-packages/django/db/models/
> > manager.py", line 75, in create
> >     return self.get_query_set().create(**kwargs)
> >   File "/usr/local/lib/python2.5/site-packages/django/db/models/
> > query.py", line 273, in create
> >     obj.save()
> >   File "/srv/django/common/tagging/models.py", line 35, in save
> >     super(Tag, self).save()
> >   File "/usr/local/lib/python2.5/site-packages/django/db/models/
> > base.py", line 271, in save
> >     instance=self, created=(not record_exists))
> >   File "/usr/local/lib/python2.5/site-packages/django/dispatch/
> > dispatcher.py", line 360, in send
> >     **named
> >   File "/usr/local/lib/python2.5/site-packages/django/dispatch/
> > robustapply.py", line 47, in robustApply
> >     return receiver(*arguments, **named)
> >   File "/srv/django/sites/haberrobotu/aggregator/models.py", line 199,
> > in mail_new_tag
> >     msg = t.render(c)
> >   File "/usr/local/lib/python2.5/site-packages/django/template/
> > __init__.py", line 174, in render
> >     return self.nodelist.render(context)
> >   File "/usr/local/lib/python2.5/site-packages/django/template/
> > __init__.py", line 795, in render
> >     return ''.join([force_unicode(b) for b in bits])
> >   File "/usr/local/lib/python2.5/site-packages/django/utils/
> > encoding.py", line 38, in force_unicode
> >     s = unicode(s)
> > UnicodeDecodeError: 'ascii' codec can't decode byte 0xc4 in position
> > 3: ordinal not in range(128)
>
> I need to improve the error handling in force_unicode() so it starts
> displaying what bogus data people passed into it. It's kind of the
> underlying solution to #5640. I might look at that when I want a break
> from other work today.
>
> Malcolm
>
> --
> The only substitute for good manners is fast 
> reflexes.http://www.pointy-stick.com/blog/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to