Porting to python3

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
triplus
Posts: 8686
Joined: Mon Dec 12, 2011 4:45 pm

Re: Porting to python3

Postby triplus » Fri Mar 08, 2019 8:35 pm

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
Posts: 1313
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: Porting to python3

Postby saso » Fri Mar 08, 2019 9:30 pm

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 477 times
triplus
Posts: 8686
Joined: Mon Dec 12, 2011 4:45 pm

Re: Porting to python3

Postby triplus » Fri Mar 08, 2019 9:56 pm

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: 27
Joined: Thu Oct 04, 2018 6:25 pm
Location: Elsau

Re: Porting to python3

Postby RogerK » Sat Mar 09, 2019 8:09 am

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
Site Admin
Posts: 14795
Joined: Thu Feb 19, 2009 10:32 am

Re: Porting to python3

Postby wmayer » 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.
User avatar
uwestoehr
Posts: 694
Joined: Sun Jan 27, 2019 3:21 am

Re: Porting to python3

Postby uwestoehr » Sun Mar 10, 2019 7:47 pm

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
Site Admin
Posts: 14795
Joined: Thu Feb 19, 2009 10:32 am

Re: Porting to python3

Postby wmayer » Sun Mar 10, 2019 9:36 pm

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

Re: Porting to python3

Postby uwestoehr » Sun Mar 10, 2019 11:31 pm

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
Posts: 8686
Joined: Mon Dec 12, 2011 4:45 pm

Re: Porting to python3

Postby triplus » Sun Mar 10, 2019 11:36 pm

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
Posts: 1313
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: Porting to python3

Postby saso » Mon Mar 11, 2019 10:08 pm

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)