id,summary,reporter,owner,description,type,status,priority,component,severity,resolution,keywords,cc,release
8369,InternalError with enabled SubversionLink options,anonymous,penmark,When I enable !SubversionLink options I get an !InternalError when I try view source via !BrowseSource.\r\n\r\n{{{\r\nTrac detected an internal error:\r\nAttributeError: 'NoneType' object has no attribute 'rstrip'\r\n\r\nPython Traceback\r\nMost recent call last:\r\n\r\n    * File "build/bdist.linux-i686/egg/trac/web/main.py"_ line 513_ in _dispatch_request\r\n      Code fragment:\r\n      Line	\r\n      508	try:\r\n      509	if not env and env_error:\r\n      510	raise HTTPInternalError(env_error)\r\n      511	try:\r\n      512	dispatcher = RequestDispatcher(env)\r\n      513	dispatcher.dispatch(req)\r\n      514	except RequestDone:\r\n      515	pass\r\n      516	resp = req._response or []\r\n      517	 \r\n      518	except HTTPException_ e:\r\n      Local variables:\r\n      Name	Value\r\n      dispatcher 	<trac.web.main.RequestDispatcher object at 0xa96038c>\r\n      e 	AttributeError("'NoneType' object has no attribute 'rstrip'"_)\r\n      env 	<trac.env.Environment object at 0xb18822c>\r\n      env_error 	None\r\n      req 	<Request "GET '/browser'">\r\n      resp 	[]\r\n    * File "build/bdist.linux-i686/egg/trac/web/main.py"_ line 256_ in dispatch\r\n      Code fragment:\r\n      Line	\r\n      251	pprint(data_ out)\r\n      252	req.send(out.getvalue()_ 'text/plain')\r\n      253	else:\r\n      254	output = chrome.render_template(req_ template_\r\n      255	data_\r\n      256	content_type)\r\n      257	# Give the session a chance to persist changes\r\n      258	req.session.save()\r\n      259	req.send(output_ content_type or 'text/html')\r\n      260	else:\r\n      261	self._post_process_request(req)\r\n      Local variables:\r\n      Name	Value\r\n      chosen_handler 	<trac.versioncontrol.web_ui.browser.BrowserModule object at 0xabe212c>\r\n      chrome 	<trac.web.chrome.Chrome object at 0xaeb5e8c>\r\n      content_type 	None\r\n      data 	{'dateinfo': <function dateinfo at 0xac8325c>_ 'file': None_ 'stickyrev': ...\r\n      err 	(<type 'exceptions.AttributeError'>_ AttributeError("'NoneType' object has ...\r\n      handler 	<trac.versioncontrol.web_ui.browser.BrowserModule object at 0xabe212c>\r\n      req 	<Request "GET '/browser'">\r\n      resp 	('browser.html'_ {'dateinfo': <function dateinfo at 0xac8325c>_ 'file': ...\r\n      self 	<trac.web.main.RequestDispatcher object at 0xa96038c>\r\n      template 	'browser.html'\r\n    * File "build/bdist.linux-i686/egg/trac/web/chrome.py"_ line 816_ in render_template\r\n      Code fragment:\r\n      Line	\r\n      811	 \r\n      812	stream = template.generate(**data)\r\n      813	 \r\n      814	# Filter through ITemplateStreamFilter plugins\r\n      815	if self.stream_filters:\r\n      816	stream |= self._filter_stream(req_ method_ filename_ stream_ data)\r\n      817	 \r\n      818	if fragment:\r\n      819	return stream\r\n      820	 \r\n      821	if method == 'text':\r\n      Local variables:\r\n      Name	Value\r\n      content_type 	'text/html'\r\n      data 	{'all': <built-in function all>_ 'pprint': <function pformat at ...\r\n      filename 	'browser.html'\r\n      fragment 	False\r\n      i 	0\r\n      method 	'xhtml'\r\n      req 	<Request "GET '/browser'">\r\n      self 	<trac.web.chrome.Chrome object at 0xaeb5e8c>\r\n      stream 	<genshi.core.Stream object at 0xab200cc>\r\n      template 	<MarkupTemplate "browser.html">\r\n      type_ 	'notices'\r\n    * File "/usr/lib/python2.5/site-packages/Genshi-0.6-py2.5.egg/genshi/core.py"_ line 132_ in __or__\r\n      Code fragment:\r\n      Line	\r\n      127	\r\n      128	:param function: the callable object that should be applied as a filter\r\n      129	:return: the filtered stream\r\n      130	:rtype: `Stream`\r\n      131	"""\r\n      132	return Stream(_ensure(function(self))_ serializer=self.serializer)\r\n      133	 \r\n      134	def filter(self_ *filters):\r\n      135	"""Apply filters to the stream.\r\n      136	\r\n      137	This method returns a new stream with the given filters applied. The\r\n      Local variables:\r\n      Name	Value\r\n      function 	<function inner at 0xafee454>\r\n      self 	<genshi.core.Stream object at 0xab200cc>\r\n    * File "build/bdist.linux-i686/egg/trac/web/chrome.py"_ line 955_ in inner\r\n      Code fragment:\r\n      Line	\r\n      950	 \r\n      951	def _filter_stream(self_ req_ method_ filename_ stream_ data):\r\n      952	def inner(stream_ ctxt=None):\r\n      953	for filter in self.stream_filters:\r\n      954	stream = filter.filter_stream(req_ method_ filename_ stream_\r\n      955	data)\r\n      956	return stream\r\n      957	return inner\r\n      958	 \r\n      959	def _stream_location(self_ stream):\r\n      960	for kind_ data_ pos in stream:\r\n      Local variables:\r\n      Name	Value\r\n      ctxt 	None\r\n      data 	{'all': <built-in function all>_ 'pprint': <function pformat at ...\r\n      filename 	'browser.html'\r\n      filter 	<contextmenu.contextmenu.SourceBrowserContextMenu object at 0xafb4b6c>\r\n      method 	'xhtml'\r\n      req 	<Request "GET '/browser'">\r\n      self 	<trac.web.chrome.Chrome object at 0xaeb5e8c>\r\n      stream 	<genshi.core.Stream object at 0xab200cc>\r\n    * File "build/bdist.linux-i686/egg/contextmenu/contextmenu.py"_ line 155_ in filter_stream\r\n      Code fragment:\r\n      Line	\r\n      150	if 'path' not in data:\r\n      151	# Probably an upstream error\r\n      152	return stream\r\n      153	# provide a link to the svn repository at the top of the Browse Source listing\r\n      154	if self.env.is_component_enabled("contextmenu.contextmenu.SubversionLink"):\r\n      155	content = SubversionLink(self.env).get_content(req_ data['path']_ stream_ data)\r\n      156	if content:\r\n      157	stream |= Transformer("//div[@id='content']/h1").after(content)\r\n      158	# No dir entries; we're showing a file\r\n      159	if not data['dir']:\r\n      160	return stream\r\n      Local variables:\r\n      Name	Value\r\n      data 	{'all': <built-in function all>_ 'pprint': <function pformat at ...\r\n      filename 	'browser.html'\r\n      method 	'xhtml'\r\n      req 	<Request "GET '/browser'">\r\n      self 	<contextmenu.contextmenu.SourceBrowserContextMenu object at 0xafb4b6c>\r\n      stream 	<genshi.core.Stream object at 0xab200cc>\r\n    * File "build/bdist.linux-i686/egg/contextmenu/contextmenu.py"_ line 90_ in get_content\r\n      Code fragment:\r\n      Line	\r\n      85	else:\r\n      86	try:\r\n      87	path = entry.path\r\n      88	except AttributeError:\r\n      89	path = entry['path']\r\n      90	href = self.svn_base_url.rstrip('/')\r\n      91	if data['reponame']:\r\n      92	href += '/' + data['reponame']\r\n      93	href += '/' + path\r\n      94	return tag.a('Subversion'_ href=href)\r\n      95	 \r\n      Local variables:\r\n      Name	Value\r\n      data 	{'all': <built-in function all>_ 'pprint': <function pformat at ...\r\n      entry 	'/'\r\n      path 	'/'\r\n      req 	<Request "GET '/browser'">\r\n      self 	<contextmenu.contextmenu.SubversionLink object at 0xad0c1cc>\r\n      stream 	<genshi.core.Stream object at 0xab200cc>\r\n\r\nFile "build/bdist.linux-i686/egg/trac/web/main.py"_ line 513_ in _dispatch_request\r\n  dispatcher.dispatch(req)\r\nFile "build/bdist.linux-i686/egg/trac/web/main.py"_ line 256_ in dispatch\r\n  content_type)\r\nFile "build/bdist.linux-i686/egg/trac/web/chrome.py"_ line 816_ in render_template\r\n  stream |= self._filter_stream(req_ method_ filename_ stream_ data)\r\nFile "/usr/lib/python2.5/site-packages/Genshi-0.6-py2.5.egg/genshi/core.py"_ line 132_ in __or__\r\n  return Stream(_ensure(function(self))_ serializer=self.serializer)\r\nFile "build/bdist.linux-i686/egg/trac/web/chrome.py"_ line 955_ in inner\r\n  data)\r\nFile "build/bdist.linux-i686/egg/contextmenu/contextmenu.py"_ line 155_ in filter_stream\r\n  content = SubversionLink(self.env).get_content(req_ data['path']_ stream_ data)\r\nFile "build/bdist.linux-i686/egg/contextmenu/contextmenu.py"_ line 90_ in get_content\r\n  href = self.svn_base_url.rstrip('/')\r\n}}}\r\n\r\n{{{\r\nSystem Information:\r\nUser Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.16) Gecko/20110102 Iceweasel/3.5.16 (like Firefox/3.5.16)\r\nTrac 	0.12\r\nGenshi 	0.6\r\nmod_wsgi 	2.5 (WSGIProcessGroup WSGIApplicationGroup %{GLOBAL})\r\npysqlite 	2.3.2\r\nPython 	2.5.2 (r252:60911_ Jan 24 2010_ 15:24:24) [GCC 4.3.2]\r\nsetuptools 	0.6c8\r\nSQLite 	3.7.3\r\nSubversion 	1.5.1 (r32289)\r\njQuery	1.4.2\r\n}}},defect,closed,high,ContextMenuPlugin,major,duplicate,,,0.12
