Tell me more ×  I am working on a cherrpy web service to work
with my web app. In this service it needs to be able to access
the file system. For example, I want to be able to list all
files under a certain directory. I am using os.walk('/public/')
but don't seem to get it to work, even though the same code
works outside of cherrpy.  Is there a way to make it work so I
can use cherrypy to manage files?  share|improve this question
add comment  1 Answer  up vote 1 down vote accepted  What user
is the webapp running as, and does it have access to read the
folder?  According to the documentation os.walk() will ignore
errors from the underlying calls to os.listdirs()  You could try
setting the onerror argument like  def print_error(error):
print error  os.walk('/public/', print_error)  which might give
you a hint as to what's going on.  Also, you could try going
directly to os.listdirs() and see if you get any errors from it.
share|improve this answer This technique solved my problem. It's
a bug in my code.