Hi, All. After upgrading to v1.0.1 (maybe before), we notice that the Bibformat Admin reports that the Default HTML brief template is "Not OK." This is with an unmodified template from the v1.0.1 source. If we click on the "Not OK" link, we receive the attached exception.
We don't see any problems when actually using this template, but any suggestions would be greatly appreciated. Many thanks, Devin Begin forwarded message: > From: <[email protected]> > Subject: Exception (textutils.py:286:encode_for_xml) at > https://edms.classe.cornell.edu > Date: July 10, 2012 5:21:03 PM EDT > To: <[email protected]> > > > Hello: > > This exception has already been seen 1 times > last time it was seen: 2012-07-10 10:45:29 > last time it was notified: 2012-07-10 10:45:29 > > The following problem occurred on <https://edms.classe.cornell.edu> > (https://edms.classe.cornell.edu) (Invenio 1.0.0) > >>> 2012-07-10 17:20:57 -> AttributeError: 'tuple' object has no attribute >>> 'replace' > >>>> User details > > agent: Mozilla/5.0 (Macintosh; Intel Mac > OS X 10_7_4) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 > Safari/534.57.2 > email: [email protected] > group: ['CLEO', 'Theses viewers'] > guest: 0 > language: en > login_method: W4restrict > nickname: dab66 > precached_permitted_restricted_collections: [] > precached_useadmin: True > precached_usealerts: True > precached_useapprove: True > precached_usebaskets: True > precached_usegroups: True > precached_useloans: True > precached_usemessages: True > precached_usestats: True > precached_viewsubmissions: True > referer: > <https://edms.classe.cornell.edu/admin/bibformat/bibformatadmin.py/format_templates_manage?ln=en> > > (https://edms.classe.cornell.edu/admin/bibformat/bibformatadmin.py/format_templates_manage?ln=en) > remote_host: > remote_ip: 24.59.125.4 > session: 7a2170e35a878bdbbda5ec9a71e36278 > uid: 17 > uri: > </admin/bibformat/bibformatadmin.py/validate_format?ln=en&bft=Default_HTML_brief.bft> > >>>> Traceback details > > Traceback (most recent call last): > File > "/usr/lib/python2.4/site-packages/invenio/webinterface_handler_wsgi.py", line > 359, in application > mp_legacy_publisher(req, possible_module, possible_handler) > File > "/usr/lib/python2.4/site-packages/invenio/webinterface_handler_wsgi.py", line > 478, in mp_legacy_publisher > return _check_result(req, module_globals[possible_handler](req, **form)) > File "<string>", line 1009, in validate_format > File "/usr/lib/python2.4/site-packages/invenio/bibformatadminlib.py", line > 1210, in perform_request_format_validate > messages = [encode_for_xml(message) for message in messages] > File "/usr/lib/python2.4/site-packages/invenio/textutils.py", line 286, in > encode_for_xml > text = text.replace('&', '&') > AttributeError: 'tuple' object has no attribute 'replace' > Locals by frame, innermost last > >>>>> Frame application in >>>>> /usr/lib/python2.4/site-packages/invenio/webinterface_handler_wsgi.py at >>>>> line 385 > ******************************************************************************* > 382 else: > 383 req.flush() > 384 except: > ----> 385 register_exception(req=req, alert_admin=True) > 386 if not req.response_sent_p: > 387 req.status = HTTP_INTERNAL_SERVER_ERROR > 388 req.headers_out['content-type'] = 'text/html' > ******************************************************************************* > start_response = '<built-in method start_response of mod_wsgi.Adapter > object at 0x850ea88>' > environ = "{'mod_wsgi.listener_port': '443', 'HTTP_COOKIE': > 'INVENIOSESSION=7a2170e35a878bdbbda5ec9a71e36278; BALANCEID=balancer.cf096; > __utma=23486248.727184314.1339770194.1341079950.1341613477.5; > __utmz=23486248.1341613477.5.5.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=cornell%20status; > __unam=eda27ea-132b03f8de7-6c48e0e0-3; > __gads=ID=bc92852b8712570b:T=1331148834:S=ALNI_MYQ6DBM0OPnj6GS-5FuZdNe7Cxf_g', > 'mod_wsgi.listener_host': '', 'SERVER_SOFTWARE': 'Apache', 'SCRIPT_NAME': > '', 'mod_wsgi.hand [...] > req = > '<invenio.webinterface_handler_wsgi.SimulatedModPythonRequest object at > 0x992f2ec>' > possible_handler = "'validate_format'" > possible_module = > "'/opt/cds-invenio/var/www/admin/bibformat/bibformatadmin.py'" > >>>>> Frame mp_legacy_publisher in >>>>> /usr/lib/python2.4/site-packages/invenio/webinterface_handler_wsgi.py at >>>>> line 497 > ******************************************************************************* > 494 cleaned_form[arg] = form.get(arg, None) > 495 return _check_result(req, > module_globals[possible_handler](req, **cleaned_form)) > 496 else: > ----> 497 raise > 498 else: > 499 raise SERVER_RETURN, HTTP_NOT_FOUND > 500 > ******************************************************************************* > module_globals = '{\'output_format_show\': <function > output_format_show at 0x992efb4>, \'wash_language\': <function wash_language > at 0x8afbbfc>, \'format_template_show\': <function format_template_show at > 0x99391ec>, \'format_element_show_dependencies\': <function > format_element_show_dependencies at 0x993941c>, \'gettext_set_language\': > <function gettext_set_language at 0x8afb224>, > \'download_dreamweaver_floater\': <function download_dreamweaver_floater at > 0x99394c4>, \'CFG_SITE_NAME\': \'CLASSE EDMS\', \'MySQLd [...] > form = "{'ln': 'en', 'bft': 'Default_HTML_brief.bft'}" > the_module = '\'## This file is part of Invenio.\\n## Copyright > (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 CERN.\\n##\\n## > Invenio is free software; you can redistribute it and/or\\n## modify it under > the terms of the GNU General Public License as\\n## published by the Free > Software Foundation; either version 2 of the\\n## License, or (at your > option) any later version.\\n##\\n## Invenio is distributed in the hope that > it will be useful, but\\n## WITHOUT ANY WARRANTY; without even the implied w > [...] > req = > '<invenio.webinterface_handler_wsgi.SimulatedModPythonRequest object at > 0x992f2ec>' > value = "Field('bft', 'Default_HTML_brief.bft')" > expected_args = "['req', 'ln', 'bfo', 'bft', 'bfe']" > possible_handler = "'validate_format'" > _check_result = '<function _check_result at 0x8d1cfb4>' > key = "'bft'" > possible_module = > "'/opt/cds-invenio/var/www/admin/bibformat/bibformatadmin.py'" > >>>>> Frame validate_format in <string> at line 1009 > req = > '<invenio.webinterface_handler_wsgi.SimulatedModPythonRequest object at > 0x992f2ec>' > auth_msg = "'Authorization granted'" > name = "'Default HTML brief'" > bfe = 'None' > title = "'Validation of Format Template Default HTML brief'" > ln = "'en'" > bft = "'Default_HTML_brief.bft'" > bfo = 'None' > navtrail_previous_links = '\'<a class="navtrail" > href="https://edms.classe.cornell.edu/help/admin">Admin Area</a> > <a > class="navtrail" > href="https://edms.classe.cornell.edu/admin/bibformat/bibformatadmin.py?ln=en">BibFormat > Admin</a> > <a class="navtrail" > href="https://edms.classe.cornell.edu/admin/bibformat/bibformatadmin.py/format_templates_manage?ln=en">Manage > Format Templates</a>\'' > auth_code = "''" > _ = '<bound method GNUTranslations.gettext of > <gettext.GNUTranslations instance at 0x87626cc>>' > uid = '17' > >>>>> Frame perform_request_format_validate in >>>>> /usr/lib/python2.4/site-packages/invenio/bibformatadminlib.py at line 1210 > ******************************************************************************* > 1207 if messages is None: > 1208 messages = [] > 1209 > ----> 1210 messages = [encode_for_xml(message) for message in messages] > 1211 > 1212 return bibformat_templates.tmpl_admin_validate_format(ln, > messages) > 1213 > ******************************************************************************* > errors = "[('ERR_BIBFORMAT_TEMPLATE_WRONG_ELEM_ARG', > 'PRIMARY_REPORT_NUMBER', 'link', None)]" > bfe = 'None' > ln = "'en'" > bfo = 'None' > messages = '[(\'ERR_BIBFORMAT_TEMPLATE_WRONG_ELEM_ARG\', > \'Format element PRIMARY_REPORT_NUMBER uses unknown parameter "link" in > format template None.\')]' > _[1] = '[]' > bft = "'Default_HTML_brief.bft'" > message = '(\'ERR_BIBFORMAT_TEMPLATE_WRONG_ELEM_ARG\', \'Format > element PRIMARY_REPORT_NUMBER uses unknown parameter "link" in format > template None.\')' > >>>>> Frame encode_for_xml in >>>>> /usr/lib/python2.4/site-packages/invenio/textutils.py at line 286 > ******************************************************************************* > 283 XML-compliant. > 284 @param text: text to encode > 285 @return: an encoded text""" > ----> 286 text = text.replace('&', '&') > 287 text = text.replace('<', '<') > 288 if wash: > 289 text = wash_for_xml(text, xml_version='1.0') > ******************************************************************************* > xml_version = "'1.0'" > text = '(\'ERR_BIBFORMAT_TEMPLATE_WRONG_ELEM_ARG\', \'Format > element PRIMARY_REPORT_NUMBER uses unknown parameter "link" in format > template None.\')' > wash = 'False' > > Best regards > -- > CLASSE EDMS <https://edms.classe.cornell.edu> > (https://edms.classe.cornell.edu) > Need human intervention? Contact > <[email protected]> > > ------------------------------------------------------------- > View this message online at: > https://hypernews.lepp.cornell.edu/lepp/get/InvenioSupport/508.html > > To access the LEPP HyperNews web interface, or to view any attachments you > see listed with this message, you will have to login using your LEPP Network > Principal. Please see > https://wiki.lepp.cornell.edu/lepp/bin/view/Computing/HyperNews for more > information, and email [email protected] with any problems or > questions.

