Hello again,

maybe it’s just a problem in my installation due to an incomplete merge, but I 
get this exception every time I try to check on an output template or format 
element.

It’s easily fixed in bibformatadminlib.py, if you remove the third tuple 
element (dummy) from every call of bibformat_engine.eval_format_element.

Greetlings, Hraban


> Von: [email protected]
> Betreff: Exception 
> (bibformatadminlib.py:403:perform_request_format_element_test) at 
> http://invenio.cerebrale.net
> Datum: 18. März 2014 10:56:46 GMT+6
> An: [email protected]
> 
> Hello:
> 
> It is the first time this exception has been seen.
> 
> 
> * 2014-03-18 05:56:46 -> ValueError: need more than 2 values to unpack 
> (bibformatadminlib.py:403:perform_request_format_element_test)
> 
> ** User details
>                                     agent: Mozilla/5.0 (Macintosh; Intel Mac 
> OS X 10_9_2) AppleWebKit/537.74.9 (KHTML, like Gecko) Version/7.0.2 
> Safari/537.74.9
>                                     email: [email protected]
>                                     group: []
>                                     guest: 0
>                                  language: de
>                              login_method: Local
>                                  nickname: admin
>            precached_canseehiddenmarctags: True
> precached_permitted_restricted_collections: []
>                    precached_sendcomments: True
>                        precached_useadmin: True
>                       precached_usealerts: True
>                      precached_useapprove: True
>                      precached_usebaskets: True
>                       precached_usegroups: True
>                        precached_useloans: True
>                     precached_usemessages: True
>             precached_usepaperattribution: True
>                   precached_usepaperclaim: True
>                        precached_usestats: True
>                   precached_viewclaimlink: False
>                 precached_viewsubmissions: True
>                                   referer: 
> <https://invenio.cerebrale.net/admin/bibformat/bibformatadmin.py/format_elements_doc?ln=en>
>                               remote_host: 
>                                 remote_ip: 92.62.69.144
>                                   session: bc80e87f80b0ef66da7db01f7df11661
>                                       uid: 1
>                                       uri: 
> </admin/bibformat/bibformatadmin.py/format_element_test?ln=en&bfe=THUMBNAIL_UCA>
> 
> ** Traceback details 
> 
> Traceback (most recent call last):
>  File 
> "/usr/local/lib/python2.6/dist-packages/invenio/webinterface_handler_wsgi.py",
>  line 505, in application
>    mp_legacy_publisher(req, possible_module, possible_handler)
>  File 
> "/usr/local/lib/python2.6/dist-packages/invenio/webinterface_handler_wsgi.py",
>  line 685, in mp_legacy_publisher
>    return _check_result(req, module_globals[possible_handler](req, **form))
>  File "<string>", line 968, in format_element_test
>  File "/usr/local/lib/python2.6/dist-packages/invenio/bibformatadminlib.py", 
> line 403, in perform_request_format_element_test
>    (result, dummy, dummy) = 
> bibformat_engine.eval_format_element(format_element, bfo, params)
> ValueError: need more than 2 values to unpack
> 
> ** Stack frame details
> 
> Frame perform_request_format_element_test in 
> /usr/local/lib/python2.6/dist-packages/invenio/bibformatadminlib.py at line 
> 403
> -------------------------------------------------------------------------------
>       400                                                search_pattern = 
> search_pattern.split(' '),
>       401                                                xml_record = None,
>       402                                                user_info = 
> user_info)
> ---->  403         (result, dummy, dummy) = 
> bibformat_engine.eval_format_element(format_element, bfo, params)
>       404     else:
>       405         try:
>       406             raise InvenioBibFormatError(_('No Record Found for 
> %s.') % search_pattern)
> -------------------------------------------------------------------------------
>                        bfe =  "'THUMBNAIL_UCA'"
>                     recIDs =  '[812]'
>                  user_info =  "{'uid': 1, 'agent': 'Mozilla/5.0 (Macintosh; 
> Intel Mac OS X 10_9_2) AppleWebKit/537.74.9 (KHTML, like Gecko) Version/7.0.2 
> Safari/537.74.9', 'precached_usegroups': True, 'session': 
> 'bc80e87f80b0ef66da7db01f7df11661', 'precached_useadmin': True, 'group': [], 
> 'guest': '0', 'precached_usepaperattribution': True, 
> 'precached_usepaperclaim': True, 'precached_viewsubmissions': True, 
> 'precached_viewclaimlink': False, 'email': '[email protected]', 
> 'precached_usealerts': True, 'precached_usestats': Tr [...]
>                         ln =  "'en'"
>               param_values =  "['recid:812', 'yes', 'icon', 'thumbnail', '', 
> '', '', '']"
>             format_element =  '{\'escape_function\': <function escape_values 
> at 0x2ac42334e578>, \'code\': <function format_element at 0x2ac42334e500>, 
> \'type\': \'python\', \'attrs\': {\'builtin_params\': [{\'default\': \'\', 
> \'name\': \'prefix\', \'description\': \'A prefix printed only if the\\n      
>                                    record has a value for this element\'}, 
> {\'default\': \'\', \'name\': \'suffix\', \'description\': \'A suffix printed 
> only if the\\n                                         record has a valu [...]
>                        bfo =  '<invenio.bibformat_engine.BibFormatObject 
> object at 0x2ac41c1cdf90>'
>                      param =  "{'default': '', 'name': 'escape', 
> 'description': '0 keeps value as it is. Refer to main\\n                      
>                    documentation for escaping modes\\n                        
>                  1 to 7'}"
>                param_names =  "['Test with record:', 'show_empty_container', 
> 'x_field', 'css_class', 'prefix', 'suffix', 'default', 'escape']"
>                      recID =  '812'
>                     params =  "{'show_empty_container': 'yes', 'suffix': '', 
> 'default': '', 'css_class': 'thumbnail', 'x_field': 'icon', 'prefix': '', 
> 'escape': ''}"
>             search_pattern =  "'recid:812'"
>         param_descriptions =  "['Enter a search query here.', 'if there is no 
> thumbnail found, return the empty div? default: True', 'value of the x 
> subfield to look for; default: icon', 'CSS class of the img element; default: 
> thumbnail', 'A prefix printed only if the\\n                                  
>        record has a value for this element', 'A suffix printed only if the\\n 
>                                         record has a value for this element', 
> 'A default value printed if the\\n                                    [...]
>                          _ =  '<bound method GNUTranslations.gettext of 
> <gettext.GNUTranslations instance at 0x2ac419115098>>'
> 
> Frame format_element_test in <string> at line 968
>                   auth_msg =  "'Authorization granted'"
>                        uid =  '1'
>                        bfe =  "'THUMBNAIL_UCA'"
>                         ln =  "'en'"
>                        req =  
> '<invenio.webinterface_handler_wsgi.SimulatedModPythonRequest object at 
> 0x2ac423352710>'
>               param_values =  'None'
>                  user_info =  "{'uid': 1, 'agent': 'Mozilla/5.0 (Macintosh; 
> Intel Mac OS X 10_9_2) AppleWebKit/537.74.9 (KHTML, like Gecko) Version/7.0.2 
> Safari/537.74.9', 'precached_usegroups': True, 'session': 
> 'bc80e87f80b0ef66da7db01f7df11661', 'precached_useadmin': True, 'group': [], 
> 'guest': '0', 'precached_usepaperattribution': True, 
> 'precached_usepaperclaim': True, 'precached_viewsubmissions': True, 
> 'precached_viewclaimlink': False, 'email': '[email protected]', 
> 'precached_usealerts': True, 'precached_usestats': Tr [...]
>       navtrail_previous_links =  '\'<a class="navtrail" 
> href="http://invenio.cerebrale.net/help/admin";>Admin Area</a> &gt; <a 
> class="navtrail" 
> href="http://invenio.cerebrale.net/admin/bibformat/bibformatadmin.py?ln=en";>BibFormat
>  Admin</a>  &gt; <a class="navtrail" 
> href="https://invenio.cerebrale.net/admin/bibformat/bibformatadmin.py/format_elements_doc?ln=en";>Format
>  Elements Documentation</a>\''
>                  auth_code =  "''"
>                          _ =  '<bound method GNUTranslations.gettext of 
> <gettext.GNUTranslations instance at 0x2ac419115098>>'
> 
> Frame mp_legacy_publisher in 
> /usr/local/lib/python2.6/dist-packages/invenio/webinterface_handler_wsgi.py 
> at line 704
> -------------------------------------------------------------------------------
>       701                         cleaned_form[arg] = form.get(arg, None)
>       702                 return _check_result(req, 
> module_globals[possible_handler](req, **cleaned_form))
>       703             else:
> ---->  704                 raise
>       705     else:
>       706         raise SERVER_RETURN, HTTP_NOT_FOUND
>       707 
> -------------------------------------------------------------------------------
>             module_globals =  '{\'output_format_show\': <function 
> output_format_show at 0x2ac423bbaaa0>, \'InvenioBibFormatError\': <class 
> \'invenio.bibformat_config.InvenioBibFormatError\'>, \'wash_language\': 
> <function wash_language at 0x2ac419202848>, \'format_template_show\': 
> <function format_template_show at 0x2ac423bbade8>, \'CFG_SITE_SECURE_URL\': 
> \'https://invenio.cerebrale.net\', \'format_element_show_dependencies\': 
> <function format_element_show_dependencies at 0x2ac424c6f2a8>, 
> \'gettext_set_language\': <function g [...]
>                 the_module =  '\'## This file is part of Invenio.\\n## 
> Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 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 
> warranty of\\ [...]
>                       form =  "{'ln': 'en', 'bfe': 'THUMBNAIL_UCA'}"
>                        req =  
> '<invenio.webinterface_handler_wsgi.SimulatedModPythonRequest object at 
> 0x2ac423352710>'
>              _check_result =  '<function _check_result at 0x2ac41b95b0c8>'
>              expected_args =  "['req', 'bfe', 'ln', 'param_values']"
>           possible_handler =  "'format_element_test'"
>                      value =  "Field('bfe', 'THUMBNAIL_UCA')"
>                        key =  "'bfe'"
>            possible_module =  
> "'/opt/invenio/var/www/admin/bibformat/bibformatadmin.py'"
> 
> Frame application in 
> /usr/local/lib/python2.6/dist-packages/invenio/webinterface_handler_wsgi.py 
> at line 531
> -------------------------------------------------------------------------------
>       528             else:
>       529                 req.flush()
>       530         except:
> ---->  531             register_exception(req=req, alert_admin=True)
>       532             if not req.response_sent_p:
>       533                 req.status = HTTP_INTERNAL_SERVER_ERROR
>       534                 req.headers_out['content-type'] = 'text/html'
> -------------------------------------------------------------------------------
>             start_response =  '<built-in method start_response of 
> mod_wsgi.Adapter object at 0x2ac422210be8>'
>                    environ =  "{'mod_wsgi.listener_port': '443', 
> 'HTTP_REFERER': 
> 'https://invenio.cerebrale.net/admin/bibformat/bibformatadmin.py/format_elements_doc?ln=en',
>  'mod_wsgi.listener_host': '', 'SERVER_SOFTWARE': 'Apache', 'SCRIPT_NAME': 
> '', 'mod_wsgi.handler_script': '', 'SERVER_SIGNATURE': '', 'REQUEST_METHOD': 
> 'GET', 'PATH_INFO': '/admin/bibformat/bibformatadmin.py/format_element_test', 
> 'SERVER_PROTOCOL': 'HTTP/1.1', 'QUERY_STRING': 'ln=en&bfe=THUMBNAIL_UCA', 
> 'SSL_TLS_SNI': 'invenio.cerebrale.net', 'HTTP_USER_AG [...]
>                        req =  
> '<invenio.webinterface_handler_wsgi.SimulatedModPythonRequest object at 
> 0x2ac423352710>'
>           possible_handler =  "'format_element_test'"
>            possible_module =  
> "'/opt/invenio/var/www/admin/bibformat/bibformatadmin.py'"
> 
> 
> 
> Best regards
> --
> eBilim <http://invenio.cerebrale.net>
> Need human intervention?  Contact <[email protected]>
> 

Reply via email to