<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 16, 2016 at 9:32 AM, Thomas De Schampheleire <span dir="ltr"><<a href="mailto:patrickdepinguin@gmail.com" target="_blank">patrickdepinguin@gmail.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
../venv/kallithea-tg/lib/python2.7/site-packages/formencode/api.py:211:<br>
in __classinit__<br>
    cls._initialize_docstring()<br>
../venv/kallithea-tg/lib/python2.7/site-packages/formencode/api.py:302:<br>
in _initialize_docstring<br>
    default = re.sub(r'(%\(.*?\)[rsifcx])', r'``\1``', default)<br>
../venv/kallithea-tg/lib64/python2.7/re.py:155: in sub<br>
    return _compile(pattern, flags).sub(repl, string, count)<br>
E   TypeError: Error when calling the metaclass bases<br>
E       expected string or buffer<br>
<br>
I tried investigating this but it is out of my league.<br>
I don't know if it is still related to internationalization or not, or<br>
to some other turbogears-specific thing.<br>
<br>
If you happen to have ideas here they are very welcome.<br>
<br>
Being stuck there, I have been working on further migration of the<br>
test suite to pytest, which is now finished, so I will be looking back<br>
at the turbogears migration.<br></blockquote><div><br></div><div>Yep, it's caused by lazy_ugettext in LoginForm messages.</div><div>_() in FormEncode schemas is not required as translation is actually done by formencode itself -> <a href="https://github.com/formencode/formencode/blob/267f05e9ec6730806fc7c143abc468421cbf94bc/formencode/api.py#L243">https://github.com/formencode/formencode/blob/267f05e9ec6730806fc7c143abc468421cbf94bc/formencode/api.py#L243</a></div><div><br></div><div>The purpose of having _() call in schemas is just for convenience for string collectors that look for all the _() calls to extract po files.</div><div><br></div><div>For this reason formencode provides a formencode.api._ function which is actually just an identity function that does nothing but flag the string as to be collected -> <a href="https://github.com/formencode/formencode/blob/267f05e9ec6730806fc7c143abc468421cbf94bc/formencode/api.py#L74">https://github.com/formencode/formencode/blob/267f05e9ec6730806fc7c143abc468421cbf94bc/formencode/api.py#L74</a></div><div><br></div><div>You should probably import that one instead of TG i18n one in model/forms.py as the only _() calls I see there are for formencode schemas.</div><div><br></div><div><br></div></div></div></div>