Edgewall Software
Modify

Opened 12 years ago

Closed 12 years ago

#9084 closed defect (fixed)

replying to a ticket comment yields 'No ngettext function available'

Reported by: Eli Carter Owned by: Eli Carter
Priority: normal Milestone: 0.12
Component: general Version: 0.12dev
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Steps to reproduce:

  • create a ticket
  • comment on the ticket
  • reply to the comment on the ticket using the Reply link

When you hit submit, you'll get AssertionError: No ngettext function available

File "/home/eli/devel/trac-trunk/trac/web/main.py", line 499, in _dispatch_request
  dispatcher.dispatch(req)
File "/home/eli/devel/trac-trunk/trac/web/main.py", line 253, in dispatch
  content_type)
File "/home/eli/devel/trac-trunk/trac/web/chrome.py", line 860, in render_template
  stream.render(method, doctype=doctype, out=buffer)
File "/home/eli/devel/genshi-trunk/genshi/core.py", line 183, in render
  return encode(generator, method=method, encoding=encoding, out=out)
File "/home/eli/devel/genshi-trunk/genshi/output.py", line 57, in encode
  for chunk in iterator:
File "/home/eli/devel/genshi-trunk/genshi/output.py", line 337, in __call__
  for kind, data, pos in stream:
File "/home/eli/devel/genshi-trunk/genshi/output.py", line 823, in __call__
  for kind, data, pos in stream:
File "/home/eli/devel/genshi-trunk/genshi/output.py", line 667, in __call__
  for kind, data, pos in stream:
File "/home/eli/devel/genshi-trunk/genshi/output.py", line 768, in __call__
  for kind, data, pos in chain(stream, [(None, None, None)]):
File "/home/eli/devel/genshi-trunk/genshi/output.py", line 583, in __call__
  for ev in stream:
File "/home/eli/devel/genshi-trunk/genshi/core.py", line 288, in _ensure
  for event in stream:
File "/home/eli/devel/genshi-trunk/genshi/core.py", line 288, in _ensure
  for event in stream:
File "/home/eli/devel/trac-trunk/trac/web/chrome.py", line 964, in _strip_accesskeys
  for kind, data, pos in stream:
File "/home/eli/devel/genshi-trunk/genshi/core.py", line 288, in _ensure
  for event in stream:
File "/home/eli/devel/trac-trunk/trac/web/chrome.py", line 953, in _generate
  for kind, data, pos in stream:
File "/home/eli/devel/genshi-trunk/genshi/template/base.py", line 592, in _include
  for event in stream:
File "/home/eli/devel/genshi-trunk/genshi/template/markup.py", line 380, in _match
  ctxt, start=idx + 1, **vars):
File "/home/eli/devel/genshi-trunk/genshi/template/markup.py", line 380, in _match
  ctxt, start=idx + 1, **vars):
File "/home/eli/devel/genshi-trunk/genshi/template/markup.py", line 330, in _match
  for event in stream:
File "/home/eli/devel/genshi-trunk/genshi/template/base.py", line 532, in _flatten
  for kind, data, pos in stream:
File "/home/eli/devel/genshi-trunk/genshi/core.py", line 288, in _ensure
  for event in stream:
File "/home/eli/devel/genshi-trunk/genshi/path.py", line 588, in _generate
  subevent = next()
File "/home/eli/devel/genshi-trunk/genshi/template/base.py", line 592, in _include
  for event in stream:
File "/home/eli/devel/genshi-trunk/genshi/template/markup.py", line 319, in _strip
  event = next()
File "/home/eli/devel/genshi-trunk/genshi/template/base.py", line 532, in _flatten
  for kind, data, pos in stream:
File "/home/eli/devel/genshi-trunk/genshi/core.py", line 288, in _ensure
  for event in stream:
File "/home/eli/devel/genshi-trunk/genshi/path.py", line 588, in _generate
  subevent = next()
File "/home/eli/devel/genshi-trunk/genshi/template/base.py", line 592, in _include
  for event in stream:
File "/home/eli/devel/genshi-trunk/genshi/template/markup.py", line 319, in _strip
  event = next()
File "/home/eli/devel/genshi-trunk/genshi/template/base.py", line 532, in _flatten
  for kind, data, pos in stream:
File "/home/eli/devel/genshi-trunk/genshi/filters/i18n.py", line 321, in __call__
  assert callable(ngettext), "No ngettext function available"

Attachments (0)

Change History (4)

comment:1 by Remy Blank, 12 years ago

This only happens when Babel is not installed. One possible fix is to return a NullTranslations subclass from get_translations(), as hinted in the comment.

comment:2 by Eli Carter, 12 years ago

Testcase added to the functional tests in [9271].

comment:3 by Remy Blank, 12 years ago

Fix committed in [9272] (with follow-up in [9273]). Unfortunately, this now triggers an XHTML validation error due to <blockquote> being placed in the wrong context.

comment:4 by Remy Blank, 12 years ago

Resolution: fixed
Status: newclosed

The XHTML validation issue is fixed in [9274], by closing an open paragraph before opening a <blockquote>.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Eli Carter.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Eli Carter to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.