str.maketrans wrongly complains about length of unicode arguments

Issue #2998 resolved
Taha Jahangir created an issue

This code works correctly in 7.0.0-alpha0, but raises an error in 7.1.0-beta0.

trans = str.maketrans('0123456789', '۰۱۲۳۴۵۶۷۸۹')

ValueError: the first two maketrans arguments must have equal length

Buggy Environment: Python 3.6.1 (de061d87e39c7df4e436974096d7982c676a859d, Apr 01 2019, 15:02:06) [PyPy 7.1.0-beta0 with GCC 8.2.1 20181127] t

Working Environment: Python 3.6.1 (dab365a46514, Feb 05 2019, 16:36:40) [PyPy 7.0.0-alpha0 with GCC 6.2.0 20160901]

Comments (1)

  1. Log in to comment