[check] run() seems to only accept [0-9a-zA-Z/-_] and special chars are quoted

Bug #528453 reported by RaiMan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SikuliX
In Progress
Medium
RaiMan

Bug Description

Sik099, OS X 10.6

The new run() command does not work as expected. seems to only accept [0-9a-zA-Z/-_.].

Interpreting the example at the end, it seems that you quote any sequence of non-[0-9a-zA-Z/-_.] characters. This leads to a very limited usability of run().

Using following script:
cmd = "" # an input for the command line
print "++++++++ run()"
print run(cmd)

print "\n++++++++ os.popen()"
import os
aus = os.popen(cmd)
for z in aus:
   print z.strip()

case: cmd = "ls -l Aperture.app"
--- same result for both commands

case: cmd = "ls -l Aperture.ap*"
--- run() empty, popen() OK

case cmd = "ps -A | grep Sikuli"
--- run() empty, popen() OK

The following 2 examples are interesting, as they accept non-[0-9a-zA-Z/-_] characters, but the handling is not as expected:
(the applescript test.scpt returns hello + the first command line parameter )

case: cmd = "osascript test.scpt \"*|#\""
++++++++ run()
hello "*|#" seems the " are double quoted
++++++++ os.popen()
hello *|#

case: cmd = "osascript test.scpt *|#"
++++++++ run()
hello *|# can only run correctly when *|# is getting quoted by run()
++++++++ os.popen()
<empty> which is correct, since this command must fail with a syntax error

Tags: fkt-run testit
RaiMan (raimund-hocke)
tags: added: 0.9.9 api
RaiMan (raimund-hocke)
Changed in sikuli:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → RaiMan (raimund-hocke)
tags: added: fkt-run
removed: 0.9.9 api
RaiMan (raimund-hocke)
Changed in sikuli:
importance: Medium → High
milestone: none → x1.1
RaiMan (raimund-hocke)
tags: added: testit
RaiMan (raimund-hocke)
Changed in sikuli:
importance: High → Medium
milestone: 1.1.0 → 2.0.0
RaiMan (raimund-hocke)
Changed in sikuli:
importance: Medium → Low
importance: Low → Medium
milestone: 2.0.0 → 2.1.0
summary: - run() seems to only accept [0-9a-zA-Z/-_] and special chars are quoted
+ [check] run() seems to only accept [0-9a-zA-Z/-_] and special chars are
+ quoted
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.