Tag Archives: python

Qué hace alguien que usa software propietario en éste caso?

Hoy estaba programando una aplicación en Python usando Twisted. Tenía un bug que me llevó un rato encontrar porque estaba en la librería, no en mi aplicación. Era un simple error en una función de una clase, la cuál rescribí en una clase derivada, cortando y pegando. Fue simple de resolver, porque tenía el código ahí. Y si no lo tenía? Por eso pregunto que hace un tipo que labura con una librería cerrada en éstos casos. Para encontrar el problema, edité el código del módulo de Python, le puse un par de prints y al rato ya sabía que pasaba. Si hubiera sido cerrada, seguramente estaría todavía vueltas…

Por cierto, ya reporté el bug: http://twistedmatrix.com/trac/ticket/6212

Post to Twitter

About the “_s” in the LDAP library (Python and others)

If you have coded using LDAP libraries you should have noticed about functions that ends with and without “_s”. That “s” means synchronous: the functions return when the operation is finished. The functions without the “s” are asynchronous: the functions return instantaneously without waiting for the end of the operation. The idea behind async functions is that you can call several LDAP functions to do different things and then you can pick the results when you need them,  without blocking the program.

I’m writing this post because you should be careful using these functions. Today I was writing a small Python script to modify some object from a DIT and I lost 30 minutes trying to figure out why the script wasn’t working. I was using the function “bind()” and then “search_s()”. The second didn’t return anything but If I searched using the command line tools with the same parameters I got the objects. What was the problem? I missed the “_s” at the end of “bind()”. I was using the async version so I was calling “search_s()” before the end of the bind operation. 🙁

Post to Twitter

Zimbra archiving with compression, the numbers

Today I calculated the space saved in one of the stores thanks to archiving+compression in one of the Zimbra servers that I’ve installed more than one ayer ago. The archiving volume has 273GB of email that uses 159GB of disk after compression. That’s 42% of saving.

I’m using a script to archive mails in the Open Source Edition that I’ve developed last year, running without any problems for more that 12 months.

It’s in my toolbox: https://github.com/diegows/toolbox

Post to Twitter