pyshell icon indicating copy to clipboard operation
pyshell copied to clipboard

Error

Open mehranexpert opened this issue 8 years ago • 2 comments

i got this Error

python3 pyshell.py http://www.myurl/sat.php
/ $ Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.5/threading.py", line 862, in run
    self._target(*self._args, **self._kwargs)
  File "pyshell.py", line 83, in tabCompleterThread
    populateTabComplete(path)
  File "pyshell.py", line 87, in populateTabComplete
    entries = makeRequest(20, 'bash', '-c "cd {} && ls -p"'.format(path)).split("\n")[:-1]
  File "pyshell.py", line 153, in makeRequest
    result = urllib.request.urlopen(url, data=requestData).read()
  File "/usr/lib/python3.5/urllib/request.py", line 163, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.5/urllib/request.py", line 472, in open
    response = meth(req, response)
  File "/usr/lib/python3.5/urllib/request.py", line 582, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.5/urllib/request.py", line 510, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.5/urllib/request.py", line 590, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden


Traceback (most recent call last):
  File "pyshell.py", line 158, in <module>
    run()
  File "pyshell.py", line 143, in run
    result = makeRequest(timeout, cmd, opts)
  File "pyshell.py", line 153, in makeRequest
    result = urllib.request.urlopen(url, data=requestData).read()
  File "/usr/lib/python3.5/urllib/request.py", line 163, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.5/urllib/request.py", line 472, in open
    response = meth(req, response)
  File "/usr/lib/python3.5/urllib/request.py", line 582, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.5/urllib/request.py", line 510, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.5/urllib/request.py", line 590, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden

mehranexpert avatar Oct 15 '16 10:10 mehranexpert

Hi mehranexpert,

As you can see from the bottom of the tracebacks you submitted, your error is: urllib.error.HTTPError: HTTP Error 403: Forbidden

You are getting a 403 Forbidden error when you are trying to access your PHP script. Most likely this means that the permissions are not set correctly on your "sat.php" file. If you are having trouble debugging your PHP script, I would suggest that you first get it working using a browser, and then switch over to PyShell once your script is working.

ojensen5115 avatar Oct 15 '16 17:10 ojensen5115

When i browse my php file its blanked page. I think it not have permission issue.

mehranexpert avatar Oct 15 '16 20:10 mehranexpert