Message class shadows built-in 'translate'
Bug #1841796 reported by
Ben Nemec
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslo.i18n |
Fix Released
|
High
|
Ben Nemec |
Bug Description
Python's unicode types already define a function named 'translate'[0]. If someone tries to call that on a Message object, they get our version of it which generally takes a different type of input parameter. This results in bugs like [1].
Ideally we would just rename our version of it, but since it's part of the public API of the library that could be problematic (although we should look into it anyway). As a partial workaround we can check the type of the input parameter, and if it's a type we can't handle we can pass it to the superclass's version of translate.
0: https:/
1: https:/
To post a comment you must log in.
Fix proposed to branch: master /review. opendev. org/679092
Review: https:/