diff options
author | ianb <ianb@localhost> | 2007-08-15 16:09:58 +0000 |
---|---|---|
committer | ianb <ianb@localhost> | 2007-08-15 16:09:58 +0000 |
commit | cdeb430061444a0aa9b4009f11b8352979e72260 (patch) | |
tree | 11009f4c7e19f968c1cfa671764d00eac5162349 | |
parent | fd5f40ba4467ec1d3342ebca0ce344f19859fc1c (diff) | |
download | pastedeploy-git-cdeb430061444a0aa9b4009f11b8352979e72260.tar.gz |
Improve the error message when there's trailing whitespace in a filename
-rw-r--r-- | paste/deploy/loadwsgi.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/paste/deploy/loadwsgi.py b/paste/deploy/loadwsgi.py index 3bb820f..29e880d 100644 --- a/paste/deploy/loadwsgi.py +++ b/paste/deploy/loadwsgi.py @@ -324,6 +324,11 @@ class ConfigLoader(_Loader): # Stupid ConfigParser ignores files that aren't found, so # we have to add an extra check: if not os.path.exists(filename): + if filename.strip() != filename: + raise OSError( + "File %r not found; trailing whitespace: " + "did you try to use a # on the same line as a filename? " + "(comments must be on their own line)" % filename) raise OSError( "File %r not found" % filename) self.parser.read(filename) |