Update my Plugin to indigo 2022.1

Posted on
Sun Dec 18, 2022 5:49 am
contrast offline
Posts: 11
Joined: Feb 26, 2009
Location: Switzerland

Update my Plugin to indigo 2022.1

Hy

i'm not e professional devloper, only hobby.
I try to update my plugins to run on indigo 2022.1 but i'm on my end...

Now it works when i launch it with Debugger but without Debugger it dosen't work
I get error with e xml file "'ascii' codec can't decode byte 0xc2 in position 3629"

I think it is something with utf-8 and ascii decode. I don't understand why it works with debugger but without not
these code is the Problem:

Code: Select all
 with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'EEP.xml'), 'r') as xml_file:
         self.soup = BeautifulSoup(xml_file.read(), "html.parser")


can someone help me please

Posted on
Tue Dec 20, 2022 8:16 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Update my Plugin to indigo 2022.1

Try specifying UTF-8 encoding when you open the EEP.xml file like this:

Code: Select all
 with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'EEP.xml'), 'r', 'utf-8') as xml_file:
         self.soup = BeautifulSoup(xml_file.read(), "html.parser")

Image

Posted on
Wed Dec 21, 2022 6:04 am
contrast offline
Posts: 11
Joined: Feb 26, 2009
Location: Switzerland

Re: Update my Plugin to indigo 2022.1

Hy Matt

Thank you but these i'v also tried, then i got error "'str' object cannot be interpreted as an integer"

...

Posted on
Wed Dec 21, 2022 12:07 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Update my Plugin to indigo 2022.1

Try this:

Code: Select all
 with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'EEP.xml'), 'r', encoding='utf-8') as xml_file:
         self.soup = BeautifulSoup(xml_file.read(), "html.parser")

Image

Posted on
Wed Dec 21, 2022 1:07 pm
contrast offline
Posts: 11
Joined: Feb 26, 2009
Location: Switzerland

Re: Update my Plugin to indigo 2022.1

yes these works

thank you very much matt 8)

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 8 guests