Author jslvtr
Recipients jslvtr, paul.moore, steve.dower, tim.golden, zach.ware
Date 2019-11-01.14:32:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1572618747.95.0.320564330748.issue38661@roundup.psfhosted.org>
In-reply-to
Content
Hello!

I've encountered what might be a bug.

Up till now we had some working code that did this:

```
maps = self.style.map('TCombobox')
if maps:
    self.style.map('DateEntry', **maps)
```

Modifying a custom style to mimic the map of another. This has worked fine until Python 3.7, because the return value of `.map` is something that you can pass to `.map` as kw and it'll process it fine.

The return value of `.map` in Python 3.7 is something like this, for the `TCombobox`:

```
<class 'dict'>: {'focusfill': [('readonly', 'focus', 'SystemHighlight')], 'foreground': [('disabled', 'SystemGrayText'), ('readonly', 'focus', 'SystemHighlightText')], 'selectforeground': [('!focus', 'SystemWindowText')], 'selectbackground': [('!focus', 'SystemWindow')]}
```

Which is as you'd expect (and the docs say): a dictionary of properties to lists, where each list can contain multiple tuples describing the required state and final value of the property.

However in Python 3.8, the value returned by `.map` is this:

```
<class 'dict'>: {'focusfill': ['readonly focus', 'SystemHighlight'], 'foreground': ['disabled', 'SystemGrayText', 'readonly focus', 'SystemHighlightText'], 'selectforeground': ['!focus', 'SystemWindowText'], 'selectbackground': ['!focus', 'SystemWindow']}
```

The tuples are missing. This then causes a number of problems downstream, such as the final property values being split into the constituent letters instead of the values within each tuple.
History
Date User Action Args
2019-11-01 14:32:27jslvtrsetrecipients: + jslvtr, paul.moore, tim.golden, zach.ware, steve.dower
2019-11-01 14:32:27jslvtrsetmessageid: <1572618747.95.0.320564330748.issue38661@roundup.psfhosted.org>
2019-11-01 14:32:27jslvtrlinkissue38661 messages
2019-11-01 14:32:27jslvtrcreate