[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/apidoc/utilitymodule/ Fixed utility module to work well with any type of utility name.

Stephan Richter srichter at cosmos.phy.tufts.edu
Sat Oct 29 09:34:33 EDT 2005


On Saturday 29 October 2005 09:14, Tarek Ziadé wrote:
> >As you can see, there's a '/' character in there, thus the traverser
> >will think that the utility name is 'SXMgdGhpcyBuYW1lIHVybCBzYWZlPz8'.
> >So it seems like you have to use urllib.quote() anyway.
> >  
>
> Otherwise we can use it like this, wich is much safer for the use case
> you have shown:
>
>  >>> import base64
>  >>> base64.urlsafe_b64encode("Is this name url safe??? Let's see.")
> 'SXMgdGhpcyBuYW1lIHVybCBzYWZlPz8_IExldCdzIHNlZS4='
>  >>>
> base64.urlsafe_b64decode('SXMgdGhpcyBuYW1lIHVybCBzYWZlPz8_IExldCdzIHNlZS4='
>) "Is this name url safe??? Let's see."

Great! Thanks you!

Regards,
Stephan
-- 
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training


More information about the Zope3-Checkins mailing list