Re: toprettyxml messes up with whitespaces

2007-10-03 Thread Legrandin
Hi Jorgen,

> I parse an XML file, replace a node with a new one (like updating cache)
> and write it back. Every write, new spaces are added.
[ ... ]
> And this goes on. The node is one that is not touched in the XML, it is
> simply written back after reading. I have the same with void spaces in
> between the nodes, I managed to compensate that by stripping the lines.

Before calling toxml/toprettyxml, I strip (with rstrip and lstrip) all 
text nodes and take care of removing all the empty ones.

Of course, this is feasible only if whitespace (space, tab, newline) is
not meaningful for the application.

Legrandin
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Pycrypto RSA Issue

2010-02-09 Thread Legrandin

> gkey = RSA.generate(384, Random.new().read)
> string = str((gkey.publickey().__getstate__(),(333,444)))

You are encrypting with RSA a piece of data which is way
larger than the key size (48 bytes).

-- 
http://mail.python.org/mailman/listinfo/python-list