Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #384 (closed defect: fixed)

Opened 13 years ago

Last modified 10 years ago

[patch] r502: admi18n "I'm feeling lucky" fails on fresh quickstart project

Reported by: anonymous Owned by: anonymous
Priority: normal Milestone: 1.x
Component: Toolbox.admi18n Version:
Severity: normal Keywords: toolbox admi18n language translate
Cc:

Description

using the toolbox to generate another language file by "I'm feeling lucky":

Server got itself in trouble

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/CherryPy-2.1.1-py2.4.egg/cherrypy/_cphttptools.py", line 271, in run
    main()
  File "/usr/lib/python2.4/site-packages/CherryPy-2.1.1-py2.4.egg/cherrypy/_cphttptools.py", line 502, in main
    body = page_handler(*args, **cherrypy.request.paramMap)
  File "/mnt/storage/www_sync/_turbogears_trunk/turbogears/controllers.py", line 240, in newfunc
    html, fragment, *args, **kw)
  File "/mnt/storage/www_sync/_turbogears_trunk/turbogears/database.py", line 189, in run_with_transaction
    retval = func(*args, **kw)
  File "/mnt/storage/www_sync/_turbogears_trunk/turbogears/controllers.py", line 257, in _execute_func
    output = func(self, *args, **kw)
  File "/mnt/storage/www_sync/_turbogears_trunk/turbogears/toolbox/admi18n/__init__.py", line 122, in po_view
    self.google_translate(code,from_lang,to_lang,kargs)
  File "/mnt/storage/www_sync/_turbogears_trunk/turbogears/toolbox/admi18n/__init__.py", line 107, in google_translate
    catalog.update(path,msg_id,translated)
  File "/mnt/storage/www_sync/_turbogears_trunk/turbogears/toolbox/admi18n/catalog.py", line 71, in update
    message_list = parse(path)
  File "/mnt/storage/www_sync/_turbogears_trunk/turbogears/toolbox/admi18n/catalog.py", line 153, in parse
    l = eval(l)
  File "<string>", line 1
    "#loginBox
             ^
SyntaxError: EOL while scanning single-quoted string

Attachments

messages.pot Download (5.3 KB) - added by anonymous 13 years ago.

Change History

comment:1 Changed 13 years ago by ronald@…

Can you please attach your pot file? From which language to which language did you try to perform the translation?

comment:2 Changed 13 years ago by anonymous

aftter updating turbogears i created a new quickstart project and imported the default set of files in admi18n. after selecting adding german as the target language and hitting the google auto-translation (english -> german) i got the servererror 500.

everything went fine the last few times i tried this some time ago. :)

Changed 13 years ago by anonymous

comment:3 follow-up: ↓ 8 Changed 13 years ago by krys@…

I just tried this with r644 and french and I get this traceback:

Page handler: <bound method Internationalization.po_view of <turbogears.toolbox.admi18n.Internationalization object at 0x011FBAF0>>
Traceback (most recent call last):
  File "e:\python24\lib\site-packages\cherrypy-2.2.0beta-py2.4.egg\cherrypy\_cphttptools.py", line 99, in _run
    self.main()
  File "e:\python24\lib\site-packages\cherrypy-2.2.0beta-py2.4.egg\cherrypy\_cphttptools.py", line 247, in main
    body = page_handler(*virtual_path, **self.params)
  File "<string>", line 3, in po_view
  File "e:\krys\turbogears\turbogears\controllers.py", line 218, in expose
    func, tg_format, html, fragment, *args, **kw)
  File "e:\krys\turbogears\turbogears\database.py", line 193, in run_with_transaction
    retval = func(*args, **kw)
  File "e:\krys\turbogears\turbogears\controllers.py", line 248, in _execute_func
    output = dispatch_error(func, self, *args, **kw)
  File "<string>", line 5, in dispatch_error
  File "e:\krys\turbogears\turbogears\controllers.py", line 300, in _default_error_handler
    return getattr(self, error_source.__name__ )(*args, **kw)
  File "<string>", line 3, in po_view
  File "e:\krys\turbogears\turbogears\controllers.py", line 214, in expose
    output = _execute_func(self, func, tg_format, html, fragment, *args, **kw)
  File "e:\krys\turbogears\turbogears\controllers.py", line 245, in _execute_func
    raise error
AttributeError: 'NoneType' object has no attribute 'groups'

I wonder if this is related.

comment:4 Changed 13 years ago by jorge.vargas

  • Milestone changed from 0.9 to 1.0

is this still happening?

comment:5 Changed 13 years ago by jorge.vargas

  • Component changed from Toolbox to Toolbox.admin18n

comment:6 Changed 12 years ago by alberto

  • Milestone changed from 1.0 to 1.1

comment:7 Changed 12 years ago by alberto

  • Milestone changed from 1.1 to __unclassified__

Batch moved into unclassified from 1.1 to properly track progress on the later

comment:8 in reply to: ↑ 3 Changed 12 years ago by joshua

Replying to krys@krys.ca:

I just tried this with r644 and french and I get this traceback:

[...]
AttributeError: 'NoneType' object has no attribute 'groups'

I wonder if this is related.

Change the lines (file "i18n/utils.py", lines 24-25)

    match = re.compile('<textarea name=q.*?>(.*?)</textarea>',
                       re.DOTALL).search(s)

to

    match = re.compile('<div id=result_box.*?>(.*?)</div',
                       re.DOTALL).search(s)     

and it should work fine.

comment:9 Changed 10 years ago by jorge.vargas

  • Summary changed from r502: admi18n "I'm feeling lucky" fails on fresh quickstart project to [patch] r502: admi18n "I'm feeling lucky" fails on fresh quickstart project
  • Milestone changed from __unclassified__ to 1.x

comment:10 Changed 10 years ago by chrisz

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in r6212.

Note: See TracTickets for help on using tickets.