New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python 2.7 support on Ubuntu 18.04 #16
Comments
Found the reason. Set in PythonEngine component on form, prop APIVersion to value <1011, eg 1010 |
so for APIVersion=1013 we get Py import with "UCS2" and this crashes with py 2.7. |
We have another stopper |
On non-windows systems the suffix needs to be ucs4. |
Try the following:
However there is another python bug which seems to be in Ubuntu only: |
Can you test whether the above works in other Linux systems or Darwin? |
@pyscripter Sorry, i have Lazarus on Ubuntu only... maybe later. |
Can you try
on your Ubuntu 2.7? |
Maybe it should be reported to the Ubuntu bug tracker as suggested by Victor Stinner. |
Ubuntu 18.04
|
The Python 2.7 that comes with MacOS 10.14 works fine with Python-4-Lazarus
|
But the last test shows that no funcs are present, it must not work |
@neurolabusc @Alexey-T
|
The Python 2.7 that comes with MacOS 10.14 works fine with Python-4-Lazarus
|
Ubuntu 18.04
For Python3
|
@Alexey-T this seems to do the trick on my Ubuntu 18.04. Essentially your code but MacOS (Darwin) should be treated like Windows (UCS2) not like Linux (UCS4)
|
@neurolabusc Darwin 2.7 appears to be UCS2 indeed. Here is my version:
|
Ubuntu 18.04
|
Fixed again. |
Seems the issue is fixed? |
This issue is related to this post, e.g. issues with Python 2.7 on Linux but not MacOS.
I downloaded the latest Python-4-Lazarus (with 64 commits) and opened on my Ubuntu 18.04 system with Lazarus 2.1.0 SVN 62040M GTK2 and FPC 3.0.4. I opened the demo_lazarus project and attempted to compile. Once I fix Py_s1 the demo runs fine if I set
cPyLibraryLinux = '/usr/lib/x86_64-linux-gnu/libpython3.6m.so';
however, if I set this to
cPyLibraryLinux = '/usr/lib/x86_64-linux-gnu/libpython2.7.so';
(which also exists on my computer), the program crashes. I added a conditional for Python3 in the PythonEngine.pas:
The program seems to run (though at launch it reports
Error: could not find symbol "PyUnicodeUCS2_AsWideChar"
), and I can run a basic Python script, but when I attempt to close the program it crashes.The crash is as follows...
Error: could not find symbol "PyUnicodeUCS2_AsWideChar"
[FORMS.PP] ExceptionOccurred
Sender=EAccessViolation
Exception=Access violation
Stack trace:
$0000000000000000
$0000000000796514 line 4665 of Sources/Core/PythonEngine.pas
$00000000004A484D
$0000000000552F19 line 5130 of include/control.inc
$0000000000540FB8 line 6645 of include/wincontrol.inc
$00000000005557EF line 40 of include/customcontrol.inc
$0000000000447CBF line 316 of include/scrollingwincontrol.inc
$0000000000449231 line 131 of include/customform.inc
$0000000000430BD0
$0000000000444BF6 line 1937 of forms.pp
$00000000004352B9
Exception at 0000000000000000: EAccessViolation:
Access violation.
The text was updated successfully, but these errors were encountered: