Porting to python3

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Porting to python3

Post by triplus »

saso wrote: Fri Mar 08, 2019 9:29 am Thanks for looking at it. I still see it with build 0.18.16078. On Win10 I get it also when I set the language to Hrvatski or Čeština (probably some others, did not test them all :) ), on Win7 I see it only with Čeština (from the tested languages).

PS: You have to change to a different WB then change back to Start WB to trigger it.
I tried Slovenian, Czech and Croatian languages and it works fine on my side (Py3/Qt5/Ubuntu). It would be great if another Windows 7/10 user could confirm the issue.
I have now the suspicion that the issue is not in the generated start page but the small tab at the bottom where the name of the view is written and that the issue is when this string contains special characters.
Tab text did cause issues in the past, but that was fixed. That is why i am suspecting the issue on your side might actually come from the content of the Start workbench page, or less likely, but i guess still possible, locale setting. Starting fresh, (re)moving existing user.cfg and system.cfg files, therefore might confirm that on your side.
User avatar
saso
Veteran
Posts: 1924
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: Porting to python3

Post by saso »

Removing user.cfg and system.cfg makes no difference. I am getting this error (and the start page does not show up) on Windows with Py3QT5-WinVS2015_x64 build. With x86_dev_win and x64_dev_win I don't get the error but I do see funny characters as shown in the attached image and looking at this character numbers I see that they are the same as in the error messages.
Attachments
bug.png
bug.png (33.32 KiB) Viewed 1883 times
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Porting to python3

Post by triplus »

Yes, on Py2 builds it's known that currently Start workbench Tab can have garbled text in it. That actually was a side effect of fixing encoding related Py3 issue. Beyond looking bad it's harmless (Py2). Anyway, if removing the user.cfg and system.cfg files didn't change anything i am out of ideas. It would be good if another Windows 7/10 user could confirm the issue. To see if it's a general issue or if we are looking for something specific.

Code: Select all

import locale
locale.getlocale()
What does it return when pasted in FreeCAD Python console?

P.S. If you don't want to share your locale publicly you can send me a PM.
RogerK
Posts: 28
Joined: Thu Oct 04, 2018 6:25 pm
Location: Elsau

Re: Porting to python3

Post by RogerK »

triplus wrote: Fri Mar 08, 2019 9:56 pm It would be good if another Windows 7/10 user could confirm the issue. To see if it's a general issue or if we are looking for something specific.
Hi. I can confirm this with the language set to Čeština on my Win10 machine. But no Problem with the language Hrvatski. Start WB fails to load due an UTF-8 decoding Problem:

Code: Select all

("(unicode error) 'utf-8' codec can't decode byte 0xda in position 0: invalid continuation byte", ('<string>', 6, 46, None))
I used the the latest conda release 0.18.16079. I restarted FC after the language switch the get the Start Webpage updated to the correct language.

Kind regards
Roger
wmayer
Founder
Posts: 20317
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Porting to python3

Post by wmayer »

git commit c1c5dd9bb is supposed to fix the tab issue. On my system I could only test it with Py2&Qt4 because there I don't have the QtWebkit module available.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: Porting to python3

Post by uwestoehr »

I just noticed that Netgen is not working with the Conda builds of FC for Windows (Py3 + Qt5).

All I get when trying to create a Netgen mesh using the Mesh WB is "Access violation". With the Py2 build Netgen works fine.
wmayer
Founder
Posts: 20317
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Porting to python3

Post by wmayer »

Using FreeCAD_0.18.15998_Conda_Py3QT5-WinVS2015_x64 works for me fine.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: Porting to python3

Post by uwestoehr »

wmayer wrote: Sun Mar 10, 2019 9:36 pm Using FreeCAD_0.18.15998_Conda_Py3QT5-WinVS2015_x64 works for me fine.
OK, it seems that only with my special file it fails with py3 but not with Py2:
https://forum.freecadweb.org/viewtopic. ... 73#p292773
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Porting to python3

Post by triplus »

RogerK wrote: Sat Mar 09, 2019 8:09 am Hi. I can confirm this with the language set to Čeština on my Win10 machine. But no Problem with the language Hrvatski.
Thanks for confirming.

With the fix added by Werner i can confirm that on my side now Start workbench Tab text is not garbled anymore, when using Py2 build and one of the mentioned languages. On Py3 build and on Ubuntu i couldn't reproduce the mentioned Windows issue anyway. Hopefully therefore Roger and/or @saso will be able to confirm the issue was fixed for them. New Conda builds are usually provided on Monday.
User avatar
saso
Veteran
Posts: 1924
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: Porting to python3

Post by saso »

wmayer wrote: Sun Mar 10, 2019 10:56 am git commit c1c5dd9bb is supposed to fix the tab issue. On my system I could only test it with Py2&Qt4 because there I don't have the QtWebkit module available.
I can confirm, with the latest build all this now seems to be working fine

... the release in the oven is starting to smell good :)

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16085 (Git)
Build type: Release
Branch: master
Hash: 6323069cbbda5ac71dff073f15cc632d8a1f3ea3
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Slovenian/Slovenia (sl_SI)
Post Reply