-1
Traceback (most recent call last):
 File "script/oic_flow_tests.py", line 232, in <module>
   p1 =Popen(["./%s.py" % args.server], stdout=PIPE)
 File "C:\python27\lib\subprocess.py", line 709, in __init__
   errread, errwrite)
 File "C:\python27\lib\subprocess.py", line 957, in _execute_child
   startupinfo)
WindowsError: [Error 2] Le fichier spÚcifiÚ est introuvable

(The French error means "file not found")

I've tried to fix it by adding shell=True in Popen, but then another error appears:

ValueError: No JSON object could be decoded"
user3301734
  • 47
  • 1
  • 4
  • Hi there. You should post the relevant code, but it appears that the file you're trying to open doesn't exist... Perhaps you got a path name wrong? You should also try to make your posts in English. I translated the Python error for you now, since most people here don't do French :-) – Martin Tournoij Feb 17 '14 at 21:12
  • Don't use `shell=True` -- instead, understand what was wrong with your Popen call in the first place. – Mike Graham Feb 17 '14 at 22:39

1 Answers1

0

"./%s.py" % args.server isn't a file.

  1. What is args.server? Why do you think the file is in your current directory?

  2. You can omit the ./ -- it doesn't do anything here.

Mike Graham
  • 73,987
  • 14
  • 101
  • 130
  • thank u for the response , i've fixed it but a new error appears Traceback (most recent call last): File "oic_flow_tests.py", line 236, in _cnf = json.loads(p1.stdout.read()) File "C:\python27\lib\json\__init__.py", line 338, in loads return _default_decoder.decode(s) File "C:\python27\lib\json\decoder.py", line 365, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\python27\lib\json\decoder.py", line 383, in raw_decode raise ValueError("No JSON object could be decoded") ValueError: No JSON object could be decoded – user3301734 Feb 17 '14 at 22:02
  • 1
    @user3301734, It sounds like `p1.stdout.read()` isn't a JSON string. You need to look at it to see what it *actually* is. – Mike Graham Feb 17 '14 at 22:38
  • (As an aside, the normal way to get the full stdout is the communicate method.) http://stackoverflow.com/questions/2502833/python-store-output-of-subprocess-popen-call-in-a-string/2502883#2502883 – Mike Graham Feb 17 '14 at 22:40