Message11041
This one boils down to the following code snippet in PyString.java:
// Not a tuple, but possibly still some kind of container: use special argIndex values.
argIndex = -1;
if (args instanceof AbstractDict
|| (!(args instanceof PySequence) && args.__findattr__("__getitem__") != null)) {
dict = args;
argIndex = -3;
}
Here
args.__findattr__("__getitem__")
is used for mapping-detection. A possible solution would be to change it into
args.object___findattr__("__getitem__")
I don't think this fix would break anything. Overriding __getattr__ to sneak in a custom __getitem__ sounds insane. And it doesn't look like CPython would fall for this kind of manipulation in %-string-format-sense.
This fix also passes regrtests. So far it looks good to me. Opinions? |
|
Date |
User |
Action |
Args |
2017-01-28 16:42:57 | stefan.richthofer | set | messageid: <1485621777.16.0.999137891896.issue2511@psf.upfronthosting.co.za> |
2017-01-28 16:42:57 | stefan.richthofer | set | recipients:
+ stefan.richthofer, progval |
2017-01-28 16:42:57 | stefan.richthofer | link | issue2511 messages |
2017-01-28 16:42:56 | stefan.richthofer | create | |
|