Trouble Using "unicode" in Python Scripts after Upgrade

Posted on
Thu May 12, 2022 7:37 am
SearchCz offline
Posts: 172
Joined: Sep 18, 2019

Trouble Using "unicode" in Python Scripts after Upgrade

Running MacOS Montery 12.0.1 and Indigo 2022.1. My embedded scripts are throwing error messages about "unicode".

When my script says:
indigo.variable.updateValue(1376345918,value=unicode(0))

The event log complains:
Script Error embedded script error:
Script Error name 'unicode' is not defined
Script Error Exception Traceback (most recent call shown last):

embedded script, line 63, at top level
NameError: name 'unicode' is not defined

I'm in the process of sifting through my scripts for similar references and making this change all over the place. Is there an easier solution?

Posted on
Thu May 12, 2022 7:59 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Trouble Using "unicode" in Python Scripts after Upgrade

Nope. You need to change ‘unicode’ to ‘str’ in all your scripts. Just one of the many changes in Python 3.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu May 12, 2022 8:52 am
SearchCz offline
Posts: 172
Joined: Sep 18, 2019

Re: Trouble Using "unicode" in Python Scripts after Upgrade

FlyingDiver wrote:
Nope. You need to change ‘unicode’ to ‘str’ in all your scripts. Just one of the many changes in Python 3.


Any trick to finding all the occurrences of "unicode" in my scripts? Like a global search ?

Posted on
Thu May 12, 2022 9:12 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Trouble Using "unicode" in Python Scripts after Upgrade

Well, you could make a copy of the Indigo database file, then search that for the string. You’ll have to decipher the XML around the scripts to figure out what schedule/trigger/action group it’s in. Or you might be able to tell from the contents of the script.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sat May 14, 2022 4:08 pm
SearchCz offline
Posts: 172
Joined: Sep 18, 2019

Re: Trouble Using "unicode" in Python Scripts after Upgrade

Turned out easier to run every script and look for error messages. Not even a big deal to do, and everything seems to be running smoothly now.

Posted on
Sun May 15, 2022 10:52 am
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Trouble Using "unicode" in Python Scripts after Upgrade

[MODERATOR NOTE]: moved to the Python 3 conversion forum.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest