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 pitrou
Recipients eric.smith, lemburg, loewis, pitrou, skrah
Date 2010-06-24.16:27:59
SpamBayes Score 2.2473192e-05
Marked as misclassified No
Message-id <1277396880.64.0.967482715948.issue9036@psf.upfronthosting.co.za>
In-reply-to
Content
> Ok, let's say we use ((unsigned char)((c) & 0xff)) also for
> __CHAR_UNSIGNED__.
> 
> What should the comment say about the intended argument?

That it's either in [-128; 127] or in [0; 255] ?

> Index: Objects/unicodeobject.c
> ===================================================================
> --- Objects/unicodeobject.c     (revision 82192)
> +++ Objects/unicodeobject.c     (working copy)
> @@ -8417,6 +8417,7 @@
>                  else if (c >= '0' && c <= '9') {
>                      prec = c - '0';
>                      while (--fmtcnt >= 0) {
> +                        /* XXX: c and *fmt are Py_UNICODE */
>                          c = Py_CHARMASK(*fmt++);

This is a funny bug:

>>> u"%.1\u1032f" % (1./3)
u'0.333333333333'

> Index: Modules/_json.c
> ===================================================================
> --- Modules/_json.c     (revision 82192)
> +++ Modules/_json.c     (working copy)
> @@ -603,6 +603,7 @@
>              }
>          }
>          else {
> +            /* XXX: c is Py_UNICODE */
>              char c_char = Py_CHARMASK(c);

This block can only be entered if c <= 0x7f (`has_unicode` is false), so it's not a problem.
History
Date User Action Args
2010-06-24 16:28:00pitrousetrecipients: + pitrou, lemburg, loewis, eric.smith, skrah
2010-06-24 16:28:00pitrousetmessageid: <1277396880.64.0.967482715948.issue9036@psf.upfronthosting.co.za>
2010-06-24 16:27:59pitroulinkissue9036 messages
2010-06-24 16:27:59pitroucreate