Unicode encoding bug

This is a legacy forum which is locked for new topics. New topics should be started in one of the other forums under Extending Indigo
Forum rules
This is a legacy forum which is locked for new topics. New topics should be started in one of the other forums under Extending Indigo
User avatar
Juju
Posts: 108
Joined: Wed Aug 31, 2011 10:16 am
Location: Toulouse - FRANCE

Unicode encoding bug

Post by Juju »

Hello,

One of my plugins was working well since several weeks, and today (or perhaps since I have installed Mountain Lion, I don't know ...) I have an error when I try to create a device :

Code: Select all

  File "plugin.py", line 415, in getContractParameters
  File "/Library/Application Support/Perceptive Automation/Indigo 5/IndigoPluginHost.app/Contents/PlugIns/plugin_base.py", line 1063, in openSerial
<type 'exceptions.UnicodeDecodeError'>: 'ascii' codec can't decode byte 0xc3 in position 7: ordinal not in range(128)
After searching in the forum, I read it is an error relating to unicode encoding. But I don't know where to search in my code ... It seems it's in openSerial, really ?
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: Unicode encoding bug

Post by jay (support) »

It looks like the ownerName parameter you're sending to openSerial contains non-ASCII characters. We should probably handle that better in the plugin base class but to work around it you should make sure that what you're passing in ownerName is ASCII text.
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
User avatar
Juju
Posts: 108
Joined: Wed Aug 31, 2011 10:16 am
Location: Toulouse - FRANCE

Re: Unicode encoding bug

Post by Juju »

Bingo !
I had some "é" in the name given to openSerial.
I don't understand why it was working before, but OK, problem is solved.

Thanks.
Locked

Return to “Extending Indigo with Plugins and Python”