-
Notifications
You must be signed in to change notification settings - Fork 49
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
Python3 support #58
base: master
Are you sure you want to change the base?
Python3 support #58
Conversation
first the problem was that the target could be non-integer and the function would not finish also the movement is now nicer
In setup.py the version string is changed from "3.5.1" to "3.4.1". Is this change intentional? This could explain the discussion in #54 |
@Werni2A changing the version number was kind of intentional to mark that the API changed to work with my python 3 setup. |
def launchapp(cmd, args = [], delay = 0, env = 1, lang = "C"): | ||
return _remote_launchapp(cmd, args, delay, env, lang) | ||
def launchapp(cmd, args = [], delay = 0, env = 1, lang = "C", logfiles = None ): | ||
return _remote_launchapp(cmd, args, delay, env, lang, logfiles) | ||
def hasstate(window_name, object_name, state, guiTimeOut = 0): | ||
return _remote_hasstate(window_name, object_name, state, guiTimeOut) | ||
def selectrow(window_name, object_name, row_text): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On line 449, there is a unicode() call that should be converted to str() for python3
implemented as suggested by @ikawada (looks good - couldn't test myself)
hi @schuellerf I test your patch, I find another 2 issue in python3:
2,
After this patch, my test script works:
|
1 similar comment
hi @schuellerf I test your patch, I find another 2 issue in python3:
2,
After this patch, my test script works:
|
@nagappan, when could this be merged? Currently python 3 is not supported by ldtp. |
@nagappan, any updates on this? |
Having no luck getting this working with python 3.8.10 get the following whenever I try to import ldtp Traceback (most recent call last): Apologies if this is an LDTP noob issue |
I was able to get the current code - apply all the fixes described in this thread - and then I was able to run a simple test. I am working on an Ubuntu 20.04 image on a Windows-10 Hyper-V VM on a small laptop. I used VS Code and Python 3.8.10. I have never contributed to anything on GitHub - if you want the code I have running, how do we/I proceed? There are some original changes that I made but most of it is the changes made by scheullerf and ikawada-zz |
@jdhicks121350 usually you just fork the repository into your GitHub account, commit/push your changes there and finally also create a pullrequest to the original project or mine (or both 😅) that does not really matter in the end (thanks to git 😉) |
When I use this branch on RHEL 9 with Python 3.9, LDTP daemon is not starting when I Command
Didn't observe this issue with python2 version. Could you let us know what might be the issue ? |
I'm having the exact problem since I moved from Ubuntu to openSUSE. I am now confused and have been trying to do exactly what you describe. I'm truing to run ldtp -s from a terminal and also using from ldtp import * and none of the examples are now working for me at all. That is why I have not submitted my code - fearing I have created a bug. On my Ubuntu box I was easily able to manipulate the Calculator APP. On openSUSE I cant get past the first "from ldtp import *" that one line just hangs like it started another process! |
Also - I have tried 3.7.12, 3.8.7, 3.9.10 and 2 different versions of SUSE - nothing has made any difference. 10 days or more now... |
It seems that the socket code cannot use the address/port combo. Is there a reservation for that address/port or another process already running there? Look in the client code and print the address and port that is being used – you could also hard code an address in that same code to see if it can use a different address/port.
Maybe a firewall issue?
.OR. (FORTRAN) there is an import issue getting something you don’t know you are getting.
J.D.
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows
From: ***@***.***>
Sent: Wednesday, July 6, 2022 7:12 AM
To: ***@***.***>
Cc: J.D. ***@***.***>; ***@***.***>
Subject: Re: [ldtp/ldtp2] Python3 support (#58)
When I use this branch on RHEL 9 with Python 3.9, LDTP daemon is not starting when I import ldtp in Python prompt / script.
Following error is generated, client is unable to connect to server.
Command ldtp is working fine on Terminal, issue is only with Python import.
>> from ldtp import * Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.9/site-packages/ldtp-3.6.0-py3.9.egg/ldtp/__init__.py", line 594, in <module> _populateNamespace(globals()) File "/usr/local/lib/python3.9/site-packages/ldtp-3.6.0-py3.9.egg/ldtp/__init__.py", line 247, in _populateNamespace for method in client._client.system.listMethods(): File "/usr/lib64/python3.9/xmlrpc/client.py", line 1122, in __call__ return self.__send(self.__name, args) File "/usr/lib64/python3.9/xmlrpc/client.py", line 1464, in __request response = self.__transport.request( File "/usr/local/lib/python3.9/site-packages/ldtp-3.6.0-py3.9.egg/ldtp/client.py", line 156, in request h=self.send_request(host, handler, request_body, bool(verbose)) File "/usr/lib64/python3.9/xmlrpc/client.py", line 1291, in send_request self.send_content(connection, request_body) File "/usr/lib64/python3.9/xmlrpc/client.py", line 1321, in send_content connection.endheaders(request_body) File "/usr/lib64/python3.9/http/client.py", line 1280, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/lib64/python3.9/http/client.py", line 1040, in _send_output self.send(msg) File "/usr/lib64/python3.9/http/client.py", line 980, in send self.connect() File "/usr/lib64/python3.9/http/client.py", line 946, in connect self.sock = self._create_connection( File "/usr/lib64/python3.9/socket.py", line 844, in create_connection raise err File "/usr/lib64/python3.9/socket.py", line 832, in create_connection sock.connect(sa) OSError: [Errno 99] Cannot assign requested address
Didn't observe this issue with python2 version. Could you let us know what might be the issue ?
—
Reply to this email directly, view it on GitHub<#58 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ANGY2BFCBENWEEKCGSGFUD3VSVS2ZANCNFSM4NILHRPQ>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
No, there is port reservation. |
OK – I get it. This morning I am taking my working code from an Ubuntu 20.04 to an openSUSE 15.4 and create the smallest possible LDTP test possible. I have way more experience with the code now and will hopefully have better insight into what should be happening vs. what is happening.
Currently I get 2 very different behaviors on the 2 different Linux distros.
The biggest issue seems to be the GDK stuff.
I swapped out the gobject with the pgi version of gobject – real bother…
your_path/site-packages/twisted/internet/gtk2reactor.py file
I’m not convinced the changes I made helped.
19 # System Imports
20 import sys
21
22 # ADD THESE TWO LINES
23 import pgi
24 from pgi.repository import GObject as gobject
25
26
27 #EXISTING CODE
28 from twisted.internet import _glibbase
29 from twisted.python import runtime
….
Then find and remove (comment it out) this line around ~LINE 51
import gobject # type: ignore[import]
ALSO – I found 2 different scripts named “ldtp” one was an installation script and the other is the one that starts the server.
I deleted the installation script.
J.D.
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows
From: ***@***.***>
Sent: Thursday, July 7, 2022 8:59 AM
To: ***@***.***>
Cc: J.D. ***@***.***>; ***@***.***>
Subject: Re: [ldtp/ldtp2] Python3 support (#58)
No, there is port reservation.
LDTP Engine uses that port but that engine is not started when we import in python prompt.
So LDTP client is unable to open socket to server ( server is not started ).
Checking for some more insights.
—
Reply to this email directly, view it on GitHub<#58 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ANGY2BEEASRHPMLV5SOF2RDVS3ICZANCNFSM4NILHRPQ>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I believe there is an issue here:
I replaced package gi wit3h the package pgi and changed the code everywhere to use pgi vs. gi
In pPackage pgi->overrides->GLib.py
Around line 797 and 803
func_fdtransform = lambda _, cond, *data: callback(channel,cond,*data)
It has too many parameters and I tried eliminating them one at a time and if I remove *data it hangs…
J.D.
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows
From: ***@***.***>
Sent: Thursday, July 7, 2022 8:59 AM
To: ***@***.***>
Cc: J.D. ***@***.***>; ***@***.***>
Subject: Re: [ldtp/ldtp2] Python3 support (#58)
No, there is port reservation.
LDTP Engine uses that port but that engine is not started when we import in python prompt.
So LDTP client is unable to open socket to server ( server is not started ).
Checking for some more insights.
—
Reply to this email directly, view it on GitHub<#58 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ANGY2BEEASRHPMLV5SOF2RDVS3ICZANCNFSM4NILHRPQ>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Hi
On my setup this fixes ldtp to work with python3
I only tested in the context of my xfce-test project: https://github.com/schuellerf/xfce-test