[Grok-dev] Re: VirutalEnv, is it for deployment (what about startup init.d)

Tres Seaver tseaver at palladion.com
Mon Dec 31 13:34:14 EST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tres Seaver wrote:
> David Bain wrote:
>> Seems to be an error with the animals demo app:
>> I can't get passed:
>> http://grok.repoze.org/animals/start/guess
> 
> Hmm, the generated URL seems to be:
> 
>   http://grok.repoze.org/animals/start/no%2Fguess
> 
> or:
> 
>   http://grok.repoze.org/animals/start/yes%2Fguess
> 
> 
> I don't know why the slash is being escaped.

I think this is a bug in the AnimalTree application, which is abusing
the 'url' method.  The following patch (now rolled out on
grok.repoze.org) fixes the generated URLs:

- --- app.py.orig 2007-12-31 18:19:34.380624246 +0000
+++ app.py      2007-12-31 18:20:18.994794470 +0000
@@ -41,13 +41,15 @@

     def yes_url(self):
         if self.context.isLeaf():
- -            return self.url('yes/guess')
+            yes = self.context['yes']
+            return self.url(yes, 'guess')
         else:
             return self.url('correct')

     def no_url(self):
         if self.context.isLeaf():
- -            return self.url('no/guess')
+            no = self.context['no']
+            return self.url(no, 'guess')
         else:
             return self.url('learn')



The fact that the paste server happens to handle the escaped slash in
the URL doesn't mean that it is "correct".  I have checked the fix in on
the AnimalTree trunk.



Tres.
- --
===================================================================
Tres Seaver          +1 540-429-0999          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHeTYl+gerLs4ltQ4RAu4CAKCbg45aUgLF/p1njdrXmStz5U5uTACdGXsu
ZFrYRa7g4IDHjLpQR4t/AOQ=
=btox
-----END PGP SIGNATURE-----



More information about the Grok-dev mailing list