#20 Problem with _escape and unicode strings in pidPDF

open
None
5
2001-02-10
2001-01-02
Anonymous
No

in pidPDF, in both _escape methods, it is taken for granted that the repr will return a dingle quoted string.

However, when the object to be escaped is a unicode string (as defined by Python 2.0), the result is u'str'.

This has the effect of leaving an extra ' at the beginning of the string. While it is easy to circumvent this problem (simply use str()) in client code, it would be better to do it in the PDF backend itself.

Discussion

  • Steve Menard
    Steve Menard
    2001-01-03

    Damn! Look like I forgot to log in when I entered the bug.

    Please send any question to me.

     
    • assigned_to: nobody --> clee
     
  • michal wallace
    michal wallace
    2005-09-25

    Logged In: YES
    user_id=1971

    Next Action:

    This should be trivial fix. Just take off an extra letter
    if it's a unicode string. (piddlePDF.py , _escape() line 251)