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.

However, on this line

```
os.chroot(tmpdir)

```

I get:

```
OSError: [Errno 1] Operation not permitted: '/tmp/tmpVnTqW7/myproj'

```

I've also tried this mini-tutorial with same results: <http://www.tutorialspoint.com/python/os_chroot.htm>

Why would that be?
Thanks