cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
418
Views
0
Helpful
1
Replies

Bulk Transcript Downloader Error

Martin Moran
Level 3
Level 3

Hello,

 

I'm trying to use the DevNet python script to download my chat transcripts from SocialMiner. I've installed Python 2.7.14 (with the requests modules pre-installed, as per the documentation says). The problem is when I execute the command "pythong 'filename.py' --host <socialminer ip> --user <username> --password <password>", I keep getting the following error:

 

Traceback (most recent call last):
  File "filename.py'", line 189, in <module>
    main()
  File "filename.py'", line 169, in main
    root = ElementTree.fromstring(search_response)
  File "C:\Python27\lib\xml\etree\ElementTree.py", line 1311, in XML
    parser.feed(text)
  File "C:\Python27\lib\xml\etree\ElementTree.py", line 1657, in feed
    self._parser.Parse(data, 0)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xbf' in position 2367: ordinal not in range(128)

 

Has anyone went through the same error?

 

URL of the script: https://devs.cisco.com/fileMedia/download/6ac1fce1-4a3a-4fa3-a22f-e91de859a7af

 

I also attached the "ElementTree.py" that is getting called by the main script. Keep in mind that I changed it to 'txt' because of the upload page requeriments.

 

1 Reply 1

namahesh
Cisco Employee
Cisco Employee

Hi Martin,

 

Oops, but good catch!

 

Basically, the bulk transcript downloader script is unable to process unicode (UTF-8 encoded) characters. (Do your transcripts have multi-byte, non-english characters in them?)

 

It is a simple fix, I will do it and re-publish this code.
Meanwhile, can you try one of these options?

 

  • OPTION 1: In your shell, export the default python encoding to UTF-8
    export PYTHONIOENCODING="UTF-8"
    Then, in the same shell, run the python script again.
  • OPTION 2: In your shell, export the default system encoding to UTF-8
    export LC_ALL=C.UTF-8
    Then, in the same shell, run the python script again.


FYI, all the sample code of SocialMiner (including this one) is available publicly on github.com now! Check out https://github.com/CiscoDevNet/socialminer-sample-code

 

Hope this helps. Let me know.

 

Thanks,

Nagendra U M