Project

General

Profile

Feature #3130

Refactor cmd/arg list for iexe_cmd

Added by Burt Holzman over 7 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Low
Category:
-
Target version:
Start date:
11/16/2012
Due date:
% Done:

0%

Estimated time:
Stakeholders:
Duration:

Description

iexe_cmd says:

# Hack to tokenize the commandline that should be executed.
# We probably should "Do the Right Thing (tm)" at some point
command_list = shlex.split(cmd.encode('utf8'))

This ticket is to "Do the Right Thing (tm)".

History

#1 Updated by Burt Holzman over 7 years ago

  • Status changed from New to Assigned
  • Assignee set to Anthony Tiradani
  • Priority changed from Normal to Low
  • Target version set to v3_1

#2 Updated by Anthony Tiradani over 7 years ago

  • Status changed from Assigned to Resolved

The comment was put in place for two reasons.

At the time, I had not tested shlex to determine what it would do with corner cases, like quoted strings, special character, or if it would attempt to type cast arguments. e.g. change "cmd arg1 2 3" to ["cmd", "arg1", 2, 3]

Second, everywhere in code, we build the command as if we are typing it out on the terminal. This is the way that the original popen calls expected input. Now, subprocess.popen expects a list. The thought was that we might want to change that eventually in code to provide a list instead of the command line string.

I discussed it with Doug and he tested a few corner cases. We are satisfied that it works as expected, and Doug will change the comments accordingly.

#3 Updated by Parag Mhashilkar about 7 years ago

  • Status changed from Resolved to Closed


Also available in: Atom PDF