id,summary,reporter,owner,description,type,status,priority,component,severity,resolution,keywords,cc,release 3485,FullBlogPlugin does not work on python 2.3,yamasaki,osimons," ---- Oops… Trac detected an internal error: NameError: global name 'sorted' is not defined If you think this should work you can reproduce the problem, you should consider reporting this to the Trac team. Before you do that, though, please first try searching for similar issues, as it is quite likely that this problem has been reported before. For questions about installation and configuration of Trac, please try the mailing list instead of filing a ticket. Otherwise, please ==== How to Reproduce ==== While doing a GET operation on `/blog`, Trac issued an internal error. ''(please provide additional details here)'' Request parameters: {{{ {'blog_path': ''} }}} User Agent was: `Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)` ==== System Information ==== || '''Trac''' || `0.11` || || '''Python''' || `2.3.5 (#1, May 5 2005, 10:58:47) ` [[br]] `[GCC 3.3.5 (Debian 1:3.3.5-12)]` || || '''setuptools''' || `0.6c8` || || '''SQLite''' || `2.8.16` || || '''pysqlite''' || `1.0.1` || || '''Genshi''' || `0.5.1` || || '''mod_python''' || `< 3.2` || || '''Subversion''' || `1.1.4 (r13838)` || || '''jQuery:''' || `1.2.3` || ==== Python Traceback ==== {{{ Traceback (most recent call last): File ""/usr/lib/python2.3/site-packages/Trac-0.11-py2.3.egg/trac/web/main.py"", line 423, in _dispatch_request dispatcher.dispatch(req) File ""/usr/lib/python2.3/site-packages/Trac-0.11-py2.3.egg/trac/web/main.py"", line 197, in dispatch resp = chosen_handler.process_request(req) File ""/usr/lib/python2.3/site-packages/TracFullBlogPlugin-0.1-py2.3.egg/tracfullblog/web_ui.py"", line 352, in process_request data['blog_months'], data['blog_authors'], data['blog_categories'], \ File ""/usr/lib/python2.3/site-packages/TracFullBlogPlugin-0.1-py2.3.egg/tracfullblog/core.py"", line 315, in get_months_authors_categories return ([(m, m_dict.get(m, 0)) for m in sorted(m_dict.keys(), reverse=True)], NameError: global name 'sorted' is not defined }}} a new ticket at the Trac project site, where you can describe the problem and explain how to reproduce it. Python Traceback Most recent call last: File ""/usr/lib/python2.3/site-packages/Trac-0.11-py2.3.egg/trac/web/main.py"", line 423, in _dispatch_request Code fragment: try: if not env and env_error: raise HTTPInternalError(env_error) try: dispatcher = RequestDispatcher(env) dispatcher.dispatch(req) except RequestDone: pass resp = req._response or [] except HTTPException, e: Local variables: Name Value after [u' except RequestDone:', u' pass', u' resp = ... before [u' try:', u' if not env and env_error:', u' raise ... dispatcher e env env_error None exc_info (, resp [] tb tb_hide None traceback 'Traceback (most recent call last):\n File ... File ""/usr/lib/python2.3/site-packages/Trac-0.11-py2.3.egg/trac/web/main.py"", line 197, in dispatch Code fragment: req.args.get('__FORM_TOKEN') != req.form_token: raise HTTPBadRequest('Missing or invalid form token. ' 'Do you have cookies enabled?') # Process the request and render the template resp = chosen_handler.process_request(req) if resp: if len(resp) == 2: # Clearsilver chrome.populate_hdf(req) template, content_type = \ self._post_process_request(req, *resp) Local variables: Name Value chosen_handler chrome err (, req self File ""/usr/lib/python2.3/site-packages/TracFullBlogPlugin-0.1-py2.3.egg/tracfullblog/web_ui.py"", line 352, in process_request Code fragment: if (not command or command.startswith('listing-')) and format == 'rss': data['context'] = Context.from_request(req, absurls=True) return 'fullblog.rss', data, 'application/rss+xml' data['blog_months'], data['blog_authors'], data['blog_categories'], \ data['blog_total'] = \ blog_core.get_months_authors_categories( user=req.authname, perm=req.perm) if 'BLOG_CREATE' in req.perm('blog'): add_ctxtnav(req, 'New Post', href=req.href.blog('create'), Local variables: Name Value action 'view' blog_core blog_month_names [u'January', u'February', u'March', u'April', u'May', u'June', u'July', ... blog_posts [] command '' count 0 data {'blog_month_names': [u'January', u'February', u'March', u'April', u'May', ... format '' listing_data {} maxcount 20 pagename '' path_items [] req self template 'fullblog_view.html' version 0 File ""/usr/lib/python2.3/site-packages/TracFullBlogPlugin-0.1-py2.3.egg/tracfullblog/core.py"", line 315, in get_months_authors_categories Code fragment: a_dict[author] = a_dict.get(author, 0) + 1 categories = post[6] # a list for category in set(categories): c_dict[category] = c_dict.get(category, 0) + 1 total += 1 return ([(m, m_dict.get(m, 0)) for m in sorted(m_dict.keys(), reverse=True)], [(a, a_dict.get(a, 0)) for a in sorted(a_dict.keys())], [(c, c_dict.get(c, 0)) for c in sorted(c_dict.keys())], total) # Internal methods Local variables: Name Value _[1] a_dict {} blog_posts [] c_dict {} from_dt None m_dict {} perm self to_dt None total 0 user u'yamasaki' File ""/usr/lib/python2.3/site-packages/Trac-0.11-py2.3.egg/trac/web/main.py"", line 423, in _dispatch_request dispatcher.dispatch(req) File ""/usr/lib/python2.3/site-packages/Trac-0.11-py2.3.egg/trac/web/main.py"", line 197, in dispatch resp = chosen_handler.process_request(req) File ""/usr/lib/python2.3/site-packages/TracFullBlogPlugin-0.1-py2.3.egg/tracfullblog/web_ui.py"", line 352, in process_request data['blog_months'], data['blog_authors'], data['blog_categories'], \ File ""/usr/lib/python2.3/site-packages/TracFullBlogPlugin-0.1-py2.3.egg/tracfullblog/core.py"", line 315, in get_months_authors_categories return ([(m, m_dict.get(m, 0)) for m in sorted(m_dict.keys(), reverse=True)], System Information: User Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) Trac: 0.11 Python: 2.3.5 (#1, May 5 2005, 10:58:47) [GCC 3.3.5 (Debian 1:3.3.5-12)] setuptools: 0.6c8 SQLite: 2.8.16 pysqlite: 1.0.1 Genshi: 0.5.1 mod_python: < 3.2 Subversion: 1.1.4 (r13838) jQuery: 1.2.3 ",defect,closed,normal,FullBlogPlugin,normal,fixed,,,0.11