title: os.chroot Operation not permitted
body: <p>I'm trying to write a python script to generate a debian package.
  I'm generating required folder structure in a temporary folder. In order to change uid and gid of /usr and subfolders to root I thought of using chroot.</p>
  
  <p>However, on this line</p>
  
  <pre><code>os.chroot(tmpdir)
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>OSError: [Errno 1] Operation not permitted: '/tmp/tmpVnTqW7/myproj'
  </code></pre>
  
  <p>I've also tried this mini-tutorial with same results: <a href="http://www.tutorialspoint.com/python/os_chroot.htm" rel="nofollow">http://www.tutorialspoint.com/python/os_chroot.htm</a></p>
  
  <p>Why would that be?
  Thanks</p>