sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #05622
[Bug 857847] Re: platform.architecture() throws exception --- not usable in Sikuli script --- try platform.platform()
I had a look at the Jython 2.5.2 code:
--- platform.architecture()
can only be used and might deliver a result, when the interpreter is started from command line (e.g. using jython.bat on Windows).
If used with java -jar python.jar, you get the sam errors as with Sikuli.
The reason: architecture() depends on sys.executable (the interpreter executable), which is None in this case (this is the case for Sikuli: it uses jython.jar).
If it returns information, it seems to return the arch of the currently used Java.
--- platform.platform()
returns a string, that at the end contains the arch info of the Java VM, your Jython script is currently running on (e.g. on Windows: x86 or amd64). So for the current Sikuli on Windows this shows always x86, since it currently needs the 32Bit JRE (if you use the official distribution)
--- conclusion:
For a Jython environment the platform module can only be used, to get the arch info of the Java VW, a script is running on.
To find out, wether you are running on a 64Bit or a 32Bit Windows, you have to use other tools.
I do not think, that this arch information is relevant for scripts running on Mac or Linux.
** Description changed:
+ ***** set to invalid: no Sikuli specific problem
+
+ see comment #1
+
+ -------------------------------------------------
+
I'm using 1.0rc2 on ubuntu and 1.0rc3 on win7, the built in (j|p)ython
module platform's .architecture function seems to be broken in sikuli.
I tried it in standard jython 2.5.2 and it worked correctly.
I tried to run the following test script in sikuli:
import sys
import platform as p
print '1:',sys.version
print '2:',p.version()
print '3:',p.system()
print '4:',p.architecture()
-
The first 3 prints work, but the 4th one, platform.architecture(), throws an exception:
in Ubuntu:
Traceback (most recent call last): File "/tmp/sikuli-tmp7875985444078552876.py", line 6, in print '4:',p.architecture() File "/mnt/junk/Downloads/sikuli_x1.0rc2_x64/Sikuli-IDE/sikuli-script.jar/Lib/platform.py", line 885, in architecture File "/mnt/junk/Downloads/sikuli_x1.0rc2_x64/Sikuli-IDE/sikuli-script.jar/Lib/platform.py", line 828, in _syscmd_file File "/mnt/junk/Downloads/sikuli_x1.0rc2_x64/Sikuli-IDE/sikuli-script.jar/Lib/platform.py", line 794, in _follow_symlinks File "/mnt/junk/Downloads/sikuli_x1.0rc2_x64/Sikuli-IDE/sikuli-script.jar/Lib/posixpath.py", line 415, in abspath File "/mnt/junk/Downloads/sikuli_x1.0rc2_x64/Sikuli-IDE/sikuli-script.jar/Lib/posixpath.py", line 52, in isabs AttributeError: 'NoneType' object has no attribute 'startswith'
in windows:
Traceback (most recent call last):
- File "C:\Users\B\AppData\Local\Temp\sikuli-tmp5102372631259310345.py", line 6, in
- print '4:',p.architecture()
- File "C:\bin\sikuli\Sikuli-IDE\sikuli-script.jar\Lib\platform.py", line 885, in architecture
- File "C:\bin\sikuli\Sikuli-IDE\sikuli-script.jar\Lib\platform.py", line 828, in _syscmd_file
- File "C:\bin\sikuli\Sikuli-IDE\sikuli-script.jar\Lib\platform.py", line 794, in _follow_symlinks
- File "C:\bin\sikuli\Sikuli-IDE\sikuli-script.jar\Lib\ntpath.py", line 493, in abspath
- File "C:\bin\sikuli\Sikuli-IDE\sikuli-script.jar\Lib\ntpath.py", line 53, in isabs
- File "C:\bin\sikuli\Sikuli-IDE\sikuli-script.jar\Lib\ntpath.py", line 119, in splitdrive
+ File "C:\Users\B\AppData\Local\Temp\sikuli-tmp5102372631259310345.py", line 6, in
+ print '4:',p.architecture()
+ File "C:\bin\sikuli\Sikuli-IDE\sikuli-script.jar\Lib\platform.py", line 885, in architecture
+ File "C:\bin\sikuli\Sikuli-IDE\sikuli-script.jar\Lib\platform.py", line 828, in _syscmd_file
+ File "C:\bin\sikuli\Sikuli-IDE\sikuli-script.jar\Lib\platform.py", line 794, in _follow_symlinks
+ File "C:\bin\sikuli\Sikuli-IDE\sikuli-script.jar\Lib\ntpath.py", line 493, in abspath
+ File "C:\bin\sikuli\Sikuli-IDE\sikuli-script.jar\Lib\ntpath.py", line 53, in isabs
+ File "C:\bin\sikuli\Sikuli-IDE\sikuli-script.jar\Lib\ntpath.py", line 119, in splitdrive
TypeError: 'NoneType' object is unsubscriptable
** Changed in: sikuli
Status: New => Invalid
--
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/857847
Title:
platform.architecture() throws exception --- not usable in Sikuli
script --- try platform.platform()
Status in Sikuli:
Invalid
Bug description:
***** set to invalid: no Sikuli specific problem
see comment #1
-------------------------------------------------
I'm using 1.0rc2 on ubuntu and 1.0rc3 on win7, the built in (j|p)ython
module platform's .architecture function seems to be broken in sikuli.
I tried it in standard jython 2.5.2 and it worked correctly.
I tried to run the following test script in sikuli:
import sys
import platform as p
print '1:',sys.version
print '2:',p.version()
print '3:',p.system()
print '4:',p.architecture()
The first 3 prints work, but the 4th one, platform.architecture(), throws an exception:
in Ubuntu:
Traceback (most recent call last): File "/tmp/sikuli-tmp7875985444078552876.py", line 6, in print '4:',p.architecture() File "/mnt/junk/Downloads/sikuli_x1.0rc2_x64/Sikuli-IDE/sikuli-script.jar/Lib/platform.py", line 885, in architecture File "/mnt/junk/Downloads/sikuli_x1.0rc2_x64/Sikuli-IDE/sikuli-script.jar/Lib/platform.py", line 828, in _syscmd_file File "/mnt/junk/Downloads/sikuli_x1.0rc2_x64/Sikuli-IDE/sikuli-script.jar/Lib/platform.py", line 794, in _follow_symlinks File "/mnt/junk/Downloads/sikuli_x1.0rc2_x64/Sikuli-IDE/sikuli-script.jar/Lib/posixpath.py", line 415, in abspath File "/mnt/junk/Downloads/sikuli_x1.0rc2_x64/Sikuli-IDE/sikuli-script.jar/Lib/posixpath.py", line 52, in isabs AttributeError: 'NoneType' object has no attribute 'startswith'
in windows:
Traceback (most recent call last):
File "C:\Users\B\AppData\Local\Temp\sikuli-tmp5102372631259310345.py", line 6, in
print '4:',p.architecture()
File "C:\bin\sikuli\Sikuli-IDE\sikuli-script.jar\Lib\platform.py", line 885, in architecture
File "C:\bin\sikuli\Sikuli-IDE\sikuli-script.jar\Lib\platform.py", line 828, in _syscmd_file
File "C:\bin\sikuli\Sikuli-IDE\sikuli-script.jar\Lib\platform.py", line 794, in _follow_symlinks
File "C:\bin\sikuli\Sikuli-IDE\sikuli-script.jar\Lib\ntpath.py", line 493, in abspath
File "C:\bin\sikuli\Sikuli-IDE\sikuli-script.jar\Lib\ntpath.py", line 53, in isabs
File "C:\bin\sikuli\Sikuli-IDE\sikuli-script.jar\Lib\ntpath.py", line 119, in splitdrive
TypeError: 'NoneType' object is unsubscriptable
To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/857847/+subscriptions
References