Ввод-вывод Unicode текста

Quick and dirty way

Воспользоваться следующими функциями: --> -->

ImportError

No module named pygments

If you want to report a bug, please save this page and attach it to your bug report.

Traceback

A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.

  1. /usr/lib/python2.5/site-packages/MoinMoin/request.py in run (self=<MoinMoin.request.RequestCGI object at 0x82d45cc>)

    1. 1205 self.page.send_page(self, msg=msg)
    2. 1206 else:
    3. 1207 handler(self.page.page_name, self)
    4. 1208
    5. 1209 # generate page footer (actions that do not want this footer use
    • handler = <function do_show at 0x84adb54>
    • self = <MoinMoin.request.RequestCGI object at 0x82d45cc>
    • self.page = <MoinMoin.Page.Page instance at 0x849d4cc>
    • self.page.page_name = u'Haskell FAQ'
  2. /usr/lib/python2.5/site-packages/MoinMoin/wikiaction.py in do_show (pagename=u'Haskell FAQ', request=<MoinMoin.request.RequestCGI object at 0x82d45cc>)

    1. 466 else:
    2. 467 request.cacheable = 1
    3. 468 Page(request, pagename).send_page(request, count_hit=1)
    4. 469
    5. 470
    • global Page = <class MoinMoin.Page.Page at 0x849459c>
    • request = <MoinMoin.request.RequestCGI object at 0x82d45cc>
    • pagename = u'Haskell FAQ'
    • ).send_page undefined
    • count_hit undefined
  3. /usr/lib/python2.5/site-packages/MoinMoin/Page.py in send_page (self=<MoinMoin.Page.Page instance at 0x85373ac>, request=<MoinMoin.request.RequestCGI object at 0x82d45cc>, msg='', **keywords={'count_hit': 1})

    1. 1254 format_args=pi_formatargs,
    2. 1255 do_cache=do_cache,
    3. 1256 start_line=pi_lines)
    4. 1257
    5. 1258 # check for pending footnotes
    • start_line undefined
    • pi_lines = 0
  4. /usr/lib/python2.5/site-packages/MoinMoin/Page.py in send_page_content (self=<MoinMoin.Page.Page instance at 0x85373ac>, request=<MoinMoin.request.RequestCGI object at 0x82d45cc>, Parser=<class MoinMoin.parser.wiki.Parser at 0x86ca4ac>, body=u'== \u0412\u0432\u043e\u0434-\u0432\u044b\u0432\u043e\u0434 Unicode \u0442\u0435\u043a\u0441\u0442\u0430 ==\n=== Quick and di...askell-unicode-support.html \u0432\u043e\u0442 \u044d\u0442\u043e\u0442] \u0431\u043b\u043e\u0433 \u043f\u043e\u0441\u0442.\n', format_args='', do_cache=1, **kw={'start_line': 0})

    1. 1345 try:
    2. 1346 code = self.loadCache(request)
    3. 1347 self.execute(request, parser, code)
    4. 1348 except Exception, e:
    5. 1349 if not is_cache_exception(e):
    • self = <MoinMoin.Page.Page instance at 0x85373ac>
    • self.execute = <bound method Page.execute of <MoinMoin.Page.Page instance at 0x85373ac>>
    • request = <MoinMoin.request.RequestCGI object at 0x82d45cc>
    • parser = <MoinMoin.parser.wiki.Parser instance at 0x8532f0c>
    • code = <code object <module> at 0x86c7b60, file "Haskell FAQ", line 2>
  5. /usr/lib/python2.5/site-packages/MoinMoin/Page.py in execute (self=<MoinMoin.Page.Page instance at 0x85373ac>, request=<MoinMoin.request.RequestCGI object at 0x82d45cc>, parser=<MoinMoin.parser.wiki.Parser instance at 0x8532f0c>, code=<code object <module> at 0x86c7b60, file "Haskell FAQ", line 2>)

    1. 1374 __file__ = os.path.join(MoinMoin.__loader__.archive, 'dummy')
    2. 1375 try:
    3. 1376 exec code
    4. 1377 except 'CacheNeedsUpdate':
    5. 1378 raise Exception('CacheNeedsUpdate')
    • code = <code object <module> at 0x86c7b60, file "Haskell FAQ", line 2>
  6. /var/spool/wiki/spbhug/cgi-bin/Haskell FAQ in ()

  7. /usr/lib/python2.5/site-packages/MoinMoin/formatter/base.py in processor (self=<MoinMoin.formatter.text_html.Formatter instance at 0x866b04c>, processor_name=u'code', lines=[u'#!code haskell', u'module UTF8 where', u'', u'-- From the Char module supplied with HBC.', u'', u'-- Take a Unicode string and encode it as a string', u'-- with the UTF8 method.', u'decodeUTF8 :: String -> String', u'decodeUTF8 "" = ""', rudecodeUTF8 (c:cs) | c < '\x80' = c : decodeUTF8 csu, rudecodeUTF8 (c:c':cs) | '\xc0' <= c && c <= '\xdf' &&u, ru '\x80' <= c' && c' <= '\xbf' =u, u" toEnum ((fromEnum c `mod` 0x20) * 0x40 + fromEnum c' `mod` 0x40) : decodeUTF8 cs", rudecodeUTF8 (c:c':c'':cs) | '\xe0' <= c && c <= '\xef' &&u, ru '\x80' <= c' && c' <= '\xbf' &&u, ru '\x80' <= c'' && c'' <= '\xbf' =u, u" toEnum ((fromEnum c `mod` 0x10 * 0x1000)...* 0x40 + fromEnum c'' `mod` 0x40) : decodeUTF8 cs", u'decodeUTF8 _ = error "UniChar.decodeUTF8: bad data"', u'', u'encodeUTF8 :: String -> String', ...], is_parser=1)

    1. 310 else:
    2. 311 parser = wikiutil.importPlugin(self.request.cfg, "parser",
    3. 312 processor_name, "Parser")
    4. 313 args = self._get_bang_args(lines[0])
    5. 314 if args is not None:
    • processor_name = u'code'
  8. /usr/lib/python2.5/site-packages/MoinMoin/wikiutil.py in importPlugin (cfg=<wikiconfig.Config instance at 0x846838c>, kind='parser', name=u'code', function='Parser')

    1. 802 """
    2. 803 try:
    3. 804 return importWikiPlugin(cfg, kind, name, function)
    4. 805 except PluginMissingError:
    5. 806 return importBuiltinPlugin(kind, name, function)
    • global importWikiPlugin = <function importWikiPlugin at 0x83de9cc>
    • cfg = <wikiconfig.Config instance at 0x846838c>
    • kind = 'parser'
    • name = u'code'
    • function = 'Parser'
  9. /usr/lib/python2.5/site-packages/MoinMoin/wikiutil.py in importWikiPlugin (cfg=<wikiconfig.Config instance at 0x846838c>, kind='parser', name=u'code', function='Parser')

    1. 815 raise PluginMissingError
    2. 816 moduleName = '%s.plugin.%s.%s' % (cfg.siteid, kind, name)
    3. 817 return importNameFromPlugin(moduleName, function)
    4. 818
    5. 819
    • global importNameFromPlugin = <function importNameFromPlugin at 0x83dea3c>
    • moduleName = u'wikiconfig.plugin.parser.code'
    • function = 'Parser'
  10. /usr/lib/python2.5/site-packages/MoinMoin/wikiutil.py in importNameFromPlugin (moduleName=u'wikiconfig.plugin.parser.code', name='Parser')

    1. 834 Raise PluginAttributeError if name does not exists.
    2. 835 """
    3. 836 module = __import__(moduleName, globals(), {}, [name])
    4. 837 try:
    5. 838 return getattr(module, name)
    • module undefined
    • builtin __import__ = <built-in function __import__>
    • moduleName = u'wikiconfig.plugin.parser.code'
    • builtin globals = <built-in function globals>
    • name = 'Parser'
  11. /var/spool/wiki/spbhug/data/plugin/parser/code.py in ()

    1. 49 import sys
    2. 50
    3. 51 from pygments import highlight
    4. 52 from pygments.lexers import get_lexer_by_name, get_lexer_for_filename, TextLexer
    5. 53 from pygments.formatters import HtmlFormatter
    • pygments undefined
    • highlight undefined

ImportError

No module named pygments

  • args = ('No module named pygments',)
  • message = 'No module named pygments'

System Details

  • Date: Thu, 09 Sep 2010 18:39:27 +0000
  • Platform: Linux trekker 2.6.26-1-686 #1 SMP Fri Mar 13 18:08:45 UTC 2009 i686
  • Python: Python 2.5.2 (/usr/bin/python)
  • MoinMoin: Release 1.5.9 (release)