{"action":"created","issue":{"url":"https://api.github.com/repos/wichert/lingua/issues/60","labels_url":"https://api.github.com/repos/wichert/lingua/issues/60/labels{/name}","comments_url":"https://api.github.com/repos/wichert/lingua/issues/60/comments","events_url":"https://api.github.com/repos/wichert/lingua/issues/60/events","html_url":"https://github.com/wichert/lingua/issues/60","id":74081846,"number":60,"title":"error when parsing mako template","user":{"login":"tisdall","id":4029388,"avatar_url":"https://avatars.githubusercontent.com/u/4029388?v=3","gravatar_id":"","url":"https://api.github.com/users/tisdall","html_url":"https://github.com/tisdall","followers_url":"https://api.github.com/users/tisdall/followers","following_url":"https://api.github.com/users/tisdall/following{/other_user}","gists_url":"https://api.github.com/users/tisdall/gists{/gist_id}","starred_url":"https://api.github.com/users/tisdall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tisdall/subscriptions","organizations_url":"https://api.github.com/users/tisdall/orgs","repos_url":"https://api.github.com/users/tisdall/repos","events_url":"https://api.github.com/users/tisdall/events{/privacy}","received_events_url":"https://api.github.com/users/tisdall/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-07T18:27:36Z","updated_at":"2015-05-07T19:35:24Z","closed_at":null,"body":"I've tried parsing my mako files with the `mako` extractor and I get:\r\n\r\n    Aborting due to parse error in ./mainserver/templates/menu.mako[24]: else: pass\r\n\r\nThat seems to be coming from the lingua/extractors/python.py as that's the only one giving a line number.  I have no idea where the \"else: pass\" is coming from as here's that section of that template (line 24 is `${name}\\`):\r\n```\r\n% if text is not None:\r\n${text}\\\r\n% else:\r\n${name}\\\r\n% endif\r\n```\r\n\r\nIs this extractor going over the compiled version of the mako template or is somehow using the wrong extractor?  My config is:\r\n```\r\n[extensions]\r\n.mako = mako\r\n.pt = chameleon\r\n.py = python\r\n\r\n[extractor:babel-mako]\r\ncomment-tags = TRANSLATORS:\r\n```\r\n\r\nI tried with the `babel-mako` and I get:\r\n```\r\n$ env/bin/pot-create -c lingua.cfg -d mainserver -o mainserver/locale/mainserver.pot mainserver\r\nTraceback (most recent call last):\r\n  File \"/sites/metrics_dev/env/lib/python3.4/site-packages/mako/lexer.py\", line 201, in decode_raw_stream\r\n    text = text.decode(parsed_encoding)\r\nUnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 3891: ordinal not in range(128)\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"env/bin/pot-create\", line 11, in <module>\r\n    sys.exit(main())\r\n  File \"/sites/metrics_dev/env/lib/python3.4/site-packages/lingua/extract.py\", line 262, in main\r\n    for message in extractor(real_filename, options):\r\n  File \"/sites/metrics_dev/env/lib/python3.4/site-packages/lingua/extractors/babel.py\", line 35, in __call__\r\n    comment_tags, self.config):\r\n  File \"/sites/metrics_dev/env/lib/python3.4/site-packages/mako/ext/babelplugin.py\", line 48, in extract\r\n    for message in extractor(fileobj):\r\n  File \"/sites/metrics_dev/env/lib/python3.4/site-packages/mako/ext/extract.py\", line 11, in process_file\r\n    input_encoding=self.config['encoding']).parse()\r\n  File \"/sites/metrics_dev/env/lib/python3.4/site-packages/mako/lexer.py\", line 215, in parse\r\n    self.filename,)\r\n  File \"/sites/metrics_dev/env/lib/python3.4/site-packages/mako/lexer.py\", line 207, in decode_raw_stream\r\n    0, 0, filename)\r\nmako.exceptions.CompileException: Unicode decode operation of encoding 'ascii' failed at line: 0 char: 0\r\n```"},"comment":{"url":"https://api.github.com/repos/wichert/lingua/issues/comments/99990848","html_url":"https://github.com/wichert/lingua/issues/60#issuecomment-99990848","issue_url":"https://api.github.com/repos/wichert/lingua/issues/60","id":99990848,"user":{"login":"tisdall","id":4029388,"avatar_url":"https://avatars.githubusercontent.com/u/4029388?v=3","gravatar_id":"","url":"https://api.github.com/users/tisdall","html_url":"https://github.com/tisdall","followers_url":"https://api.github.com/users/tisdall/followers","following_url":"https://api.github.com/users/tisdall/following{/other_user}","gists_url":"https://api.github.com/users/tisdall/gists{/gist_id}","starred_url":"https://api.github.com/users/tisdall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tisdall/subscriptions","organizations_url":"https://api.github.com/users/tisdall/orgs","repos_url":"https://api.github.com/users/tisdall/repos","events_url":"https://api.github.com/users/tisdall/events{/privacy}","received_events_url":"https://api.github.com/users/tisdall/received_events","type":"User","site_admin":false},"created_at":"2015-05-07T19:35:23Z","updated_at":"2015-05-07T19:35:23Z","body":"Ah..  I think I found the code at https://bitbucket.org/zzzeek/mako/src/f07e53dc08dcd8ed4a991539185c3e983413de06/mako/ext/linguaplugin.py?at=master\r\n\r\nLine 29 is what's tossing that \" pass\" on there.  And that code seems to be what's using the python extractor."}}