501 error message displays request path rather than filename.
Replacing "/" with os.path.sep in cases of filesystem path processing.

Also replaced a use of os.path.dirname() with an equivalent expression not
involved os.path, since the os.path version assumes os.path.sep == "/".
Merge branch 'pathsep'