Hello.  Several times here we've run into this bug here at my work.
It happens when someone adds a line like this to their apps.ini:

domain lab.dev.rd.imagescape.com port 443 / = config:landscaper.ini    
#lab-preview

Then we run into the not-fun-situation of paste not loading up with:

OSError: File /iscape/web/lab/etc/python/landscaper.ini     not found

... it's because of all of the whitespace before the comment.  Paste
reads that as part of the filename, which screws things up when it
hits:

        if not os.path.exists(filename):
            raise OSError(
                "File %r not found" % filename)

Thus people have to put comments with no whitespace at the end of the
line like so:

domain lab.dev.rd.imagescape.com port 443 / = config:landscaper.ini#lab-preview

Plenty ugly, and pretty non-intuitive.  Why not just strip the
whitespace?  So I've submitted a patch that does just that, and it
seems to work.

Index: loadwsgi.py
===================================================================
--- loadwsgi.py	(revision 6851)
+++ loadwsgi.py	(working copy)
@@ -260,7 +260,7 @@
             path = relative_to + '/' + path
     if path.startswith('///'):
         path = path[2:]
-    path = urllib.unquote(path)
+    path = urllib.unquote(path).strip()
     loader = ConfigLoader(path)
     if global_conf:
         loader.update_defaults(global_conf, overwrite=False)
_______________________________________________
Paste-users mailing list
[email protected]
http://webwareforpython.org/cgi-bin/mailman/listinfo/paste-users

Reply via email to