Author eryksun
Recipients ben.knight, eryksun, serhiy.storchaka
Date 2016-03-01.16:31:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1456849877.91.0.984298337253.issue26464@psf.upfronthosting.co.za>
In-reply-to
Content
It duplicates translated characters as well. For example:

    >>> table = str.maketrans('mnopqrb', 'rqponm\u0100', 'a')
    >>> 'aaaaaamnopqrb'.translate(table)
    'rqponmrqponmĀ'

3.4 returns the correct result:

    >>> table = str.maketrans('mnopqrb', 'rqponm\u0100', 'a')
    >>> 'aaaaaamnopqrb'.translate(table)
    'rqponmĀ'

The problem is the new fast path for one-to-one ASCII mapping (unicode_fast_translate in Objects/unicodeobject.c) doesn't have a way to return the current input position in order to resume processing the translation. _PyUnicode_TranslateCharmap assumes it's the same as the current writer position, which is wrong when input characters have been deleted.
History
Date User Action Args
2016-03-01 16:31:18eryksunsetrecipients: + eryksun, serhiy.storchaka, ben.knight
2016-03-01 16:31:17eryksunsetmessageid: <1456849877.91.0.984298337253.issue26464@psf.upfronthosting.co.za>
2016-03-01 16:31:17eryksunlinkissue26464 messages
2016-03-01 16:31:17eryksuncreate