By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,212 Members | 1,144 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,212 IT Pros & Developers. It's quick & easy.

os.remove OSError: [Errno 13] Permission denied

P: n/a
Please put me in CC

When running the following program I get frequent errors like this one

Exception in thread Thread-4:
Traceback (most recent call last):
File "C:\Python24\lib\", line 442, in __bootstrap
File "", line 25, in run
OSError: [Errno 13] Permission denied:

When leaving out the touch statement(line 24) in the loop of the class,
I do not get any errors.
This is on Windows XP SP2 with python-2.4.2 (you should have an exe
touch somewhere in you path for this to work)
Can somebody shed any light on this please?

Thanks in advance

Joram Agten
import os
import tempfile
import threading
import subprocess

def touch(filename):
output = str()
process = subprocess.Popen("touch " + filename ,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT,

class this(threading.Thread):
def __init__(self):

def run(self):
for i in range(0, 100):
filename = tempfile.mktemp()
f = open(filename, 'w')

getters = []
for i in range(0, 10):
getter = this()

for getter in getters:

Visit Telindus Access Products at Cebit 2006, Hall 13, Booth 34, 9-15 March 2006.
Discover Telindus' range of access & surveillance products in a live "voice and video over DSL" demo and collect the new catalogue 2006-2007. See you in Hannover!
Feb 1 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.