[Zope] Base64 - Encoding/Decoding without external method

Lombardoni, Andrea lombardo at inf.ethz.ch
Mon Feb 7 16:15:30 EST 2005


>> I would like to decode/encode data in base64 without resorting
>> to an external Python method.

> The following is in the Python interpreter, but I have verified that
> it works for Python scripts in Zope.

>>> "Hello World!".encode('base64')
>> 'SGVsbG8gV29ybGQh\n'
>>> 'SGVsbG8gV29ybGQh\n'.decode('base64')
>> 'Hello World!'
>>> 'Clguba ebpxf!'.decode('rot13')
>> u'Python rocks!'

I tried your suggestion, but it does not work in Zope.

I createad a simple Script(Python) object like this:

print 'ciao ciao'.encode('base64')
return printed

But when I try to see it from Zope it returns this error:

Error Type: SystemError
Error Value: module "encodings.base64" failed to register

Bye


More information about the Zope mailing list