No, but I think there is a bug in PyCXX wrt Py3. IIRC then an option might be to use the class Py::PythonClass instead of Py::PythonExtension
Porting to python3
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Porting to python3
is our included pycxx updated?
simple changing the base class didn't work for me:
simple changing the base class didn't work for me:
Code: Select all
/home/k/projects/FreeCAD/src/Gui/View3DViewerPy.cpp: In static member function ‘static void Gui::View3DInventorViewerPy::init_type()’:
/home/k/projects/FreeCAD/src/Gui/View3DViewerPy.cpp:50:5: error: ‘add_varargs_method’ was not declared in this scope
- curiouscow
- Posts: 3
- Joined: Mon Jan 07, 2019 1:48 am
Re: Porting to python3
Here are the irregularities I have noticed when working with the Py3/QT5 AppImage (up to 15900):
* two of the icons are missing (see attached image). An AppImage packaging problem ?
* when exporting a TechDraw document in .pdf format, the template is not exported (example is attached). This works with py2 version.
* Formatting of the splash screen does not look right. Version number is in the wrong place.
Overall, I like the py3/QT5 version a lot. Feels snappier and looks better.
OS: Ubuntu 18.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15900 (Git) AppImage
Build type: Release
Branch: master
Hash: a73b10203ab1cb31df4a8763b050d64da8e81580
Python version: 3.6.7
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
* two of the icons are missing (see attached image). An AppImage packaging problem ?
* when exporting a TechDraw document in .pdf format, the template is not exported (example is attached). This works with py2 version.
* Formatting of the splash screen does not look right. Version number is in the wrong place.
Overall, I like the py3/QT5 version a lot. Feels snappier and looks better.
OS: Ubuntu 18.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15900 (Git) AppImage
Build type: Release
Branch: master
Hash: a73b10203ab1cb31df4a8763b050d64da8e81580
Python version: 3.6.7
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
- Attachments
-
- Test_TD_pdf_py3.pdf
- (185.57 KiB) Downloaded 62 times
-
- Test_TD_pdf_py2.pdf
- (374.12 KiB) Downloaded 59 times
-
- Test_TD_pdf.FCStd
- (102.31 KiB) Downloaded 76 times
-
- Missing_icons.png (19.57 KiB) Viewed 1822 times
Re: Porting to python3
I still see this error, if it is not something to complex to fix it would be nice to fix it before the releasesaso wrote: ↑Tue Jan 15, 2019 1:21 pmAbout this error I have found this as a possible solution https://stackoverflow.com/questions/124 ... -byte-0x9csaso wrote: ↑Sat Jan 12, 2019 12:44 pm But I am also not able to load a translation of the start page, for example if I set the language to Slovenian I get
Code: Select all
("(unicode error) 'utf-8' codec can't decode byte 0xe8 in position 2: invalid continuation byte", ('<string>', 6, 46, None))
But I don't quite know where in our code I should do this change to test if it works
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15998 (Git)
Build type: Release
Branch: master
Hash: 5791c341be797ff2eee99eccac53df71db510fae
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)
- wandererfan
- Veteran
- Posts: 6320
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: Porting to python3
So far, this appears to be a Qt4 vs Qt5 issue rather that py2 vs py3.curiouscow wrote: ↑Sat Feb 23, 2019 7:33 pm * when exporting a TechDraw document in .pdf format, the template is not exported (example is attached). This works with py2 version.
py2/Qt4 works
py2/qt5 doesn't work (fc daily)
py3/qt5 doesn't work
There are apparently a lot of changes to Qt's print functions in Qt5, but I haven't found one that would cause this yet.
- wandererfan
- Veteran
- Posts: 6320
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: Porting to python3
If I change the Page to use a different Template, the PDF export works. OS: Linux Mint 19curiouscow wrote: ↑Sat Feb 23, 2019 7:33 pm * when exporting a TechDraw document in .pdf format, the template is not exported (example is attached). This works with py2 version.
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16027 +1 (Git)
Build type: debug
Branch: 3DShot
Hash: eeee8d929fd17ef372fe4fa45d6480cef8e74887
Python version: 3.6.7
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Canada (en_CA)
Re: Porting to python3
I have seen such report before but ATM i can't reproduce this on Ubuntu 16.04.curiouscow wrote: ↑Sat Feb 23, 2019 7:33 pm * two of the icons are missing (see attached image). An AppImage packaging problem ?
Two encoding related issues in Start workbench recently got resolved and i can't reproduce the mentioned one. Highly likely therefore the character is coming form somewhere else, and that was not addressed yet, or some sort of locale issue is at play. If you temporary move user.cfg and system.cfg to some other location and start FreeCAD. Is the problem still reproducible?
- wandererfan
- Veteran
- Posts: 6320
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: Porting to python3
The template has a large rectangle with opacity set to zero as the top most item. If I move this rectangle to the bottom of the pile and change its colour/opacity, the export works fine.curiouscow wrote: ↑Sat Feb 23, 2019 7:33 pm * when exporting a TechDraw document in .pdf format, the template is not exported (example is attached). This works with py2 version.
Re: Porting to python3
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). 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.triplus wrote: ↑Sun Mar 03, 2019 4:53 pmTwo encoding related issues in Start workbench recently got resolved and i can't reproduce the mentioned one. Highly likely therefore the character is coming form somewhere else, and that was not addressed yet, or some sort of locale issue is at play. If you temporary move user.cfg and system.cfg to some other location and start FreeCAD. Is the problem still reproducible?
PS: You have to change to a different WB then change back to Start WB to trigger it.