how I fix unicode error in Python Dexterity Type?
<p>I created one Dexterity Type using python, and the code is:</p>

<pre><code># -*- coding: utf-8 -*-
from plone.app.textfield import RichText
from plone.autoform import directives
from plone.namedfile import field as namedfile
from plone.supermodel.directives import fieldset
from plone.supermodel import model
from z3c.form.browser.radio import RadioFieldWidget
from zope import schema
from zope.schema.vocabulary import SimpleVocabulary
from zope.schema.vocabulary import SimpleTerm
from DateTime import DateTime

from projetime.ged import MessageFactory as _

TipoDeDocumentoVocabulary = SimpleVocabulary(
    [SimpleTerm(value=u'processo', title=_(u'Processos')),
     SimpleTerm(value=u'contratos', title=_(u'Contratos')),
     SimpleTerm(value=u'outros', title=_(u'Outros'))]
)

TipoDeUploadVocabulary = SimpleVocabulary(
    [SimpleTerm(value=u'sim', title=_(u'Sim')),
     SimpleTerm(value=u'nao', title=_(u'NÃ£o'))]
)

agora = DateTime()

class IDigitalFile(model.Schema):
    """Dexterity-Schema
    """

    directives.widget(TipoDeDocumento=RadioFieldWidget)
    TipoDeDocumento = schema.Choice(
        title=_(u"Tipo de Documento"),
        vocabulary=TipoDeDocumentoVocabulary,
        required=True
    )

    titulo = schema.TextLine(
        title=_(u"TÃ­tulo"),
        required=True
    )

    codDoDocumento = schema.TextLine(
        title=_(u"CÃ³d. do Documento"),
        required=False
    )

    CpfCnpj = schema.TextLine(
        title=_(u"CPF/CNPJ"),
        required=False
    )

    Assunto = schema.TextLine(
        title=_(u"Assunto"),
        required=True
        )

    Tipo = schema.TextLine(
        title=_(u"Tipo"),
        required=False
    )

    Descricao = schema.Text(
        title=_(u"DescriÃ§Ã£o"),
        required=True
    )

    fieldset('File', fields['Arquivo'] )
    Arquivo = namedfile.NamedBlobFile(
        title=_(u"Arquivo Digitalizado"),
        required=True
    )

    directives.omitted(['Automatico', 'uploded_at'])
    directives.read_permission(Automatico="cmf.ManagePortal")
    directives.write_permission(Automatico="cmf.ManagePortal")
    directives.widget(Automatico=RadioFieldWidget)
    Automatico = schema.Bool(
        Title=_(u"Upload via Script?"),
        vocabulary=TipoDeUploadVocabulary,
        required=True,
        default=u"NÃ£o"
    )

    directives.read_permission(uploded_at="cmf.ManagePortal")
    directives.write_permission(uploded_at="cmf.ManagePortal")
    uploded_at = schema.Datetime(
        title=_(u"Data de Upload"),
        required=True,
        default=agora
    )
</code></pre>

<p>And the error is:</p>

<p><code>WrongType: (&lt;zope.i18nmessageid.message.MessageFactory object at 0x7f118f168890&gt;, &lt;type 'unicode'&gt;, 'title')</code></p>

<p>I Set up in fist line:</p>

<p><code># -*- coding: utf-8 -*-</code></p>

<p>But the error persists.</p>

<p>The solutions is change the line 13:</p>

<p><code>from projetime.ged import MessageFactory as _</code></p>

<p>to:</p>

<p><code>from projetime.ged import _</code></p>

<p>Like see here <a href="https://github.com/plone/Products.CMFPlone/issues/386" rel="nofollow">https://github.com/plone/Products.CMFPlone/issues/386</a></p>

python zope dexterity plone-4.x