1

I'm on python3 and not found any module to work with svn, and choose to make it myself

First of all i create a list of parameters: cmd

and later run this code:

p = subprocess.call(cmd,
            stdout=subprocess.PIPE)

the value for cmd is:

['svn', 'add', '*', '--force', '--auto-props', '--parents', '--depth', 'infinity']

running the code is showing this warning:

svn: warning: '/Users/kuait/Documents/SVN/wk/*' not found

if i run this in shell it works, I think subprocess is interpreting the * as a file or dir

Marco Herrarte
  • 1,540
  • 5
  • 21
  • 42
  • 2
    When you use `subprocess.call` with an array of arguments, no shell is involved to expand the `*` wildcard, so the `*` gets passed directly to `svn` which looks for that as a filename. You could instead use `os.system` (which takes a single string and executes it with a shell) or build a list of items to add yourself. – nobody May 14 '14 at 16:20
  • Great, i just add shell=True and change the cmd to make it a str and works :D – Marco Herrarte May 14 '14 at 16:26
  • http://pysvn.tigris.org is the first link for the search: "python 3 svn". – jfs May 16 '14 at 03:40
  • related: [Wildcard not working in subprocess call using shlex](http://stackoverflow.com/q/7156892/4279) – jfs May 16 '14 at 03:43

0 Answers0