[reportlab-users] Python 3, bad output with repr()

Lele Gaifax lele at metapensiero.it
Thu Nov 28 11:02:04 EST 2013


Robin Becker <robin at reportlab.com> writes:


> On 28/11/2013 14:08, Lele Gaifax wrote:

> I had this issue already; it seems in their wisdom the Python Gods

> changed the behaviour of repr so that it pretty much only escapes the

> first 32 unicode points. That means all sorts of higher order

> characters that used to be encoded as 0xf7 or u2345 are now regarded

> as printable and are then pushed into strings as they are. The

> equivalent of the old behaviour is a function called ascii (or

> alternatively the %a format).


Uhm, but the strings I'm using in the given example do not contain any
fancy char, most of them are actually the empty string ('') and even
that comes out as “b''”.

Maybe the "Subject" is misleading: I'm not using repr() within my code,
but rather the PDF output contains (some) strings as if they were
processed thru repr().

Thanks&bye, lele.
--
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
lele at metapensiero.it | -- Fortunato Depero, 1929.



More information about the reportlab-users mailing list