title: PermissionError: [Errno 13] Permission denied while running a server-side CGI scripts coded in Python
body: <p>I am trying to run a server-side cgi script coded in python but I am getting the following error while running it.</p>
  
  <pre><code>Traceback (most recent call last):
    File "webserver.py", line 16, in &lt;module&gt;
      srvrobj = HTTPServer(srvraddr,CGIHTTPRequestHandler)
    File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/socketserver.py", line 449, in __init__
      self.server_bind()
    File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/server.py", line 137, in server_bind
      socketserver.TCPServer.server_bind(self)
    File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/socketserver.py", line 463, in server_bind
      self.socket.bind(self.server_address)
  PermissionError: [Errno 13] Permission denied
  </code></pre>
  
  <p>Here is the script that I am trying to run.</p>
  
  <pre><code>"""
  Implement an HTTP web server in Python that knows how to run server-side
  CGI scripts coded in Python; serves files and scripts from current working
  dir; Python scripts must be stored in webdir\cgi-bin or webdir\htbin;
  
  """
  
  import os,sys
  from http.server import HTTPServer, CGIHTTPRequestHandler
  
  webdir = '.'
  port = 80       #default http://localhost/, else use http://localhost:xxxx/
  
  os.chdir(webdir)
  srvraddr  = ("",port)
  srvrobj = HTTPServer(srvraddr,CGIHTTPRequestHandler)
  srvrobj.serve_forever()
  </code></pre>
  
  <p>Any help will be appreciated. Thanks in advance.</p>