a bug in maskededit.py

I believe there exist a bug in maskededit.py. In the code below the range is
the same for lower case and upper case. The lower case range should be
"65,90". I registered on trac but I am not allowed to post a new bug. So I
posted here. This is from the 2.8.9.1 source.

def _adjustKey(self, pos, key):
        """ Apply control formatting to the key (e.g. convert to upper
etc). """
        field = self._FindField(pos)
        if field._forceupper and key in range(97,123):
            key = ord( chr(key).upper())

        if field._forcelower and key in range(97,123):
            key = ord( chr(key).lower())

        return key

Should be:

def _adjustKey(self, pos, key):
        """ Apply control formatting to the key (e.g. convert to upper
etc). """
        field = self._FindField(pos)
        if field._forceupper and key in range(97,123):
            key = ord( chr(key).upper())

        if field._forcelower and key in range(65,90):
            key = ord( chr(key).lower())

        return key

···

--
John Fabiani

johnf wrote:

I believe there exist a bug in maskededit.py. In the code below the range is the same for lower case and upper case. The lower case range should be
"65,90". I registered on trac but I am not allowed to post a new bug.

If you are logged in you should be able to use the New Ticket button (wxTrac has been migrated to GitHub Issues - wxWidgets). Perhaps the old page without the button is stuck in your cache?

So I posted here. This is from the 2.8.9.1 source.

def _adjustKey(self, pos, key):
        """ Apply control formatting to the key (e.g. convert to upper etc). """
        field = self._FindField(pos)
        if field._forceupper and key in range(97,123):
            key = ord( chr(key).upper())

        if field._forcelower and key in range(97,123):
            key = ord( chr(key).lower())

        return key

Should be:

def _adjustKey(self, pos, key):
        """ Apply control formatting to the key (e.g. convert to upper etc). """
        field = self._FindField(pos)
        if field._forceupper and key in range(97,123):
            key = ord( chr(key).upper())

        if field._forcelower and key in range(65,90):
            key = ord( chr(key).lower())

        return key

I've made the change, but shouldn't this be locale specific instead of just forcing the use of ascii uppercase and lowercase letters?

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!