Search found 2749 matches

Go to advanced search

by looo
Sat Jan 23, 2016 4:35 pm
Forum: Developers corner
Topic: Porting to python3
Replies: 940
Views: 89169

Re: Porting to python3

There are two ways to handle this in Python3: Use PyUnicode_AsEncodedObject plus PyBytes_AsString or only use PyUnicode_AsUTF8. In the Base::Console class we also use PyUnicode_AsEncodedObject and there we now use PyUnicode_AsUTF8 for Python3 So the second method is suggested? If not please merge t...
by looo
Fri Jan 22, 2016 9:21 pm
Forum: Developers corner
Topic: Porting to python3
Replies: 940
Views: 89169

Re: Porting to python3

[*] Console doesn't show trace-back I have spend some time debugging this and found out that it's related to this function: https://github.com/yorikvanhavre/FreeCAD/blob/py3-10/src/Gui/PythonConsolePy.cpp#L165 PyObject* unicode = PyUnicode_AsEncodedObject(output.ptr(), "utf-8", "strict"); Errors ge...
by looo
Fri Jan 22, 2016 3:27 pm
Forum: Developers corner
Topic: Porting to python3
Replies: 940
Views: 89169

Re: Porting to python3

Would it be possible to set PYTHON_SUFFIX and PYTHON_BASENAME with -D PYTHON_PREFIX=.... or with cmake-gui. Right now there is no such option in cmake-gui.
by looo
Fri Jan 22, 2016 11:18 am
Forum: Developers corner
Topic: Porting to python3
Replies: 940
Views: 89169

Re: Porting to python3

the pyside error I have posted before is caused by this: https://github.com/yorikvanhavre/FreeCA ... s.txt#L774. Changing this to the correct python_version works for me. In my case this was ".cpython-35m-x86_64-linux-gnu".
by looo
Thu Jan 21, 2016 12:32 pm
Forum: Open discussion
Topic: pybind11
Replies: 3
Views: 623

pybind11

https://pybind11.readthedocs.org/en/latest/
This project is similar to boost python, but header only and c++11. The wrapper classes/functions are directly written in c++. For me this is the easiest way to get connected to c++ from python. Maybe this is useful for someone else.
by looo
Thu Jan 21, 2016 12:17 pm
Forum: Developers corner
Topic: Porting to python3
Replies: 940
Views: 89169

Re: Porting to python3

So the plan is to have first a branch which supports both python versions, merge this branch into master and than leave python2 behind?
by looo
Thu Jan 21, 2016 12:12 pm
Forum: Python scripting and macros
Topic: Why doesn't freecad modules look like normal python modules?
Replies: 26
Views: 4265

Re: Why doesn't freecad modules look like normal python modules?

Do you get a stack trace when running FreeCAD in the debugger? Posted here as it is related to python3 and not to this topic. I now try to compile PySide for python3.5. Doing this throws an error which states that PySide doesn't support python3.5 by now :D I have no idea why there is a PySide for p...
by looo
Thu Jan 21, 2016 10:52 am
Forum: Developers corner
Topic: Porting to python3
Replies: 940
Views: 89169

Re: Porting to python3

Two things that I have encountered during some testing: [*] Console doesn't show trace-back [*] import PySide crashes: Program received signal SIGSEGV, Segmentation fault. 0x00007fffe71406fe in Py_InitModule4_64 () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0 (gdb) bt #0 0x00007fffe71406fe in ...
by looo
Thu Jan 21, 2016 10:34 am
Forum: Python scripting and macros
Topic: Why doesn't freecad modules look like normal python modules?
Replies: 26
Views: 4265

Re: Why doesn't freecad modules look like normal python modules?

With this I now have problems loading the PySide module (crash). Any ideas where this is coming from?
I have tried this with the latest python3 branch from yorik. Importing PySide crash immediately. So this isn't related to the changes I have made inside the Init stuff.
by looo
Mon Jan 18, 2016 11:17 pm
Forum: Python scripting and macros
Topic: Why doesn't freecad modules look like normal python modules?
Replies: 26
Views: 4265

Re: Why doesn't freecad modules look like normal python modules?

I made some experiments with the python3 branch.
https://github.com/looooo/FreeCAD/commi ... 798d60709d

With this I now have problems loading the PySide module (crash). Any ideas where this is coming from?

Go to advanced search