OpenERP 6.1 and reportlib issue on Ubuntu 14+: how to fix _splitWord for unicode / bytes bug

Credits: https://bitbucket.org/rptlab/reportlab/commits/aed0e2af45460b241f7712bfcf68a948c658ba76

It looks like there is a bug in python reportlib. In Ubuntu 14+, there is 3.x version of reportlib and several people report that it has several bugs, one of them is when we split strings in unicode.

In the link about there is a fix, which we can apply in order to get more stability in our installation.

Symptoms:

There is an OpenERP bux as follows: https://github.com/OCA/OCB/issues/78

It looks like the bug appears when we generates reports. The final problem reports an erron in a file as follows:

/usr/lib/python2.7/dist-packages/reportlab/platypus/paragraph.py

and it says that non ascii characters cannot be encoded properly.

Fix:

We just need to make changes in the mentioned above file according to the changes from the page mentioned in credits of my article.