LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Output Delimited error - "ascii' codec can't encode characters"

    Employee
    Posted 01-13-2012 04:02

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: dvs79

    Hi!

    There's an error when trying to output the table to CSV-file:

    Got Python exception

    Installing log (01/13/2012 13:59:20) ...
    2012-01-13 13:59:20; Level: 3; Type: 0; Desc: "'ascii' codec can't encode characters in position 0-4: ordinal not in range(128)"; File: "C:\Program Files\Lavastorm\LAE 4.5\platform\windows-x86-32\python\lib\encodings\utf_8.py"; Line: 16; Context: "decode( ) - Exception"
    2012-01-13 13:59:20; Level: 3; Type: 0; Desc: "Error pumping node (Traceback (most recent call last):
    File "C:\Program Files\Lavastorm\LAE 4.5\lib\python\lavastorm\brain\python1.py", line 913, in Run
    while n.pump(quant):
    File "C:\BRAINscratch\tmp\brain\unnamed\default\temp.je t-756146774ff.1144.2432.1326452360203.prop", line 100, in pump
    self.writeRecord(rec)
    File "C:\BRAINscratch\tmp\brain\unnamed\default\temp.je t-756146774ff.1144.2432.1326452360203.prop", line 27, in writeRecord
    field = field.decode('utf_8').encode('unicode_escape')
    File "C:\Program Files\Lavastorm\LAE 4.5\platform\windows-x86-32\python\lib\encodings\utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
    UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-4: ordinal not in range(128)
    )"; File: "C:\Program Files\Lavastorm\LAE 4.5\platform\windows-x86-32\python\lib\encodings\utf_8.py"; Line: 16; Context: "decode( ) - Exception"
    Uninstalling log (01/13/2012 13:59:20) ...

    Error in sys.excepthook:Traceback (most recent call last): File "C:\Program Files\Lavastorm\LAE 4.5\lib\python\lavastorm\brain\python1.py", line 948, in <lambda> return lambda exc, value, tb: Python1ExceptHook(control, exc, value, tb)TypeError: 'NoneType' object is not callableOriginal exception was:Traceback (most recent call last): File "C:\BRAINscratch\tmp\brain\unnamed\default\temp.je t-756146774ff.1144.2433.1326452360203.prop", line 1, in <module> import lavastorm.brain.python1 File "C:\Program Files\Lavastorm\LAE 4.5\lib\python\lavastorm\brain\python1.py", line 957, in <module> runMain() File "C:\Program Files\Lavastorm\LAE 4.5\lib\python\lavastorm\brain\python1.py", line 955, in runMain raise BrainNodeException, "Encountered error running node"lavastorm.brain.python1.BrainNodeException: Encountered error running node

    Supposedly the problem with cyrillic characters in one of the fields? How to fix it?

    The example graph and data are in attachment.

    Thanks!
    Attachments:
    Piter_all_norm_IDs.zip
    ToCSV_ascii error_example.brg


  • 2.  RE: Output Delimited error - "ascii' codec can't encode characters"

    Employee
    Posted 01-18-2012 07:04

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Tim Meagher

    Hi,

    There is an issue here with the Output Delimited node - this has been raised as a bug in our system and we will look at fixing this as soon as possible.

    As a workaround, it *might* be possible, using the windows-1251 character set within BRE and on your server, to change this to string (as opposed to unicode) data - using the str() function in BRAINscript. Then try using the Output Delimited node....

    Tim.


  • 3.  RE: Output Delimited error - "ascii' codec can't encode characters"

    Employee
    Posted 01-18-2012 07:50

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: dvs79

    Yes, after converting this field into string it outputted to csv without error.
    But the convertion itself is incorrect - squares instead of letters.