This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients BreamoreBoy, asvetlov, gpolo, hans.bering, kbk, r.david.murray, serhiy.storchaka, terry.reedy
Date 2013-09-15.22:42:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1379284920.4.0.435164809262.issue12558@psf.upfronthosting.co.za>
In-reply-to
Content
Perhaps we can fix it on the Python side. When self.tk is called with a configuration cnf, cnf is often (always?) first passed to Misc._options, as in BaseWidget.__init__:
        self.tk.call(
            (widgetName, self._w) + extra + self._options(cnf))

Misc._options loops through cnf.items looking for values to and modify (currently callables, tuples, and lists) before passing the result on to tk.call.

We could make a list *countkeys* of cnf (configuration) count items fed to strtod. Then, with that loop, if the locale uses comma decimal separators (or always) convert float values for those keys to ints.

  if comma and k in countkeys: v = int(v)  # or
  if comma and k in countkeyw and isinstance(v, float): v = int(v)

I am presuming that tk truncates fractional parts as int() does; if not, use round().

I cannot verify the bug on US Win7 3.3.2 because 'de_DE.utf8' is an 'unsupported locale' for me. For the C locale, I verified that tk silently accept not only non-integral widths, but also negative widths.
History
Date User Action Args
2013-09-15 22:42:00terry.reedysetrecipients: + terry.reedy, kbk, gpolo, r.david.murray, asvetlov, hans.bering, BreamoreBoy, serhiy.storchaka
2013-09-15 22:42:00terry.reedysetmessageid: <1379284920.4.0.435164809262.issue12558@psf.upfronthosting.co.za>
2013-09-15 22:42:00terry.reedylinkissue12558 messages
2013-09-15 22:42:00terry.reedycreate