title: Using permissions for Linux chmod
body: <p>I am trying the following way for executing <code>/bin/chmod</code>.</p>
  
  <pre class="lang-py prettyprint-override"><code>from subprocess import Popen, PIPE
  
  x = oct(0o755)
  
  p = Popen(["/bin/chmod", x, "test.py"])
  o,e = p.communicate()
  </code></pre>
  
  <p>When I am using the above script, I am getting the following output</p>
  
  <pre><code>[sujata@vm ~]$ /usr/local/bin/python3.6 test_chmod.py 
  /bin/chmod: invalid mode: ‘0o755’
  Try '/bin/chmod --help' for more information.
  </code></pre>
  
  <p>In the above code if I am assigning <code>x="0755"</code> and passing it to <code>Popen</code>, it works as expected. However, Python3.6 has a different way of octal representation. I am wondering if this is the right way or am I missing here something? </p>