[1.1.1] subprocess.Popen does not seem to work on macOS 10.12+ --- fixed 1.1.2 2017-09-15

Bug #1717461 reported by RaiMan
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SikuliX
Fix Committed
Critical
RaiMan

Bug Description

Hello,

I am in the process of creating a script that will run through various Unreal demos for me - it will launch them with a few arguments and then kill the process. So far, I am focusing on having A process launch with Sikuli on mac.

I have been using subprocess.Popen and I can launch the demo and other apps from the MacOS terminal just fine using Python. When I try the same code in Sikuli, nothing seems to happen - no process opens, the IDE just reappears with no output as if it has successfully completed the script. I have the code to print the output of the process to the screen, but nothing is output.

----------------------
My Code:

import subprocess

com = subprocess.Popen("/Applications/Calculator.app/Contents/MacOS/Calculator", stdout=subprocess.PIPE, stderr=subprocess.STDOUT)

result = com.stdout.read()
print(result)
-----------------------

When running this, I see this output:

2017-09-14 17:15:40.308 JavaAppLauncher[4260:119455] No Info.plist file in application bundle or no NSPrincipalClass in the Info.plist file, exiting

Again, the calc app does not open. However, when I change my code to run one of the Unreal demos I have on my system, I see no output at all, yet I do see other prints I have, such as "I am here" to help me follow the code.

The Unreal demo location for me is here: /Users/test/Desktop/Mac_Unreal4.17/Hallway.app/Contents/MacOS/Hallway

I have been able to use Sikuli on my Win10 machine to do this exact same task - so I know Sikuli is up to the job.

I am running nightly build 2017-09-14 and MacOS 10.13 (Beta 9) 17A360a -- starting to wonder if this is a Beta issue.

Any help or idea would be appreciated - thanks.

Revision history for this message
RaiMan (raimund-hocke) wrote :

Do not ask me why, but putting a "preemptive" import subprocess into Sikuli.py (which in turn is run as strtup of a scriptrun) fixed the issue.

Changed in sikuli:
status: New → Fix Committed
importance: Undecided → Critical
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 1.1.2
Revision history for this message
Aleks Kozaev (aleksboyyy) wrote :

Hello, RaiMan!
Could you elaborate on this. I am currently using Sikuli version 2.0.0 and the same thing happens to me. As I understood I should just add "import subprocess" to the Sikuli.py? But this didn't do anything.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.