Message2822
 
            
            
            
 
   
   
 
 
  
      
Actually I spoke too soon, there's one issue -- this patch will break formatting unicode chars with values larger than 255:
Jython 2.3a0 on java1.5.0_07
Type "copyright", "credits" or "license" for more information.
>>> u'%c' % 256
Traceback (innermost last):
  File "<console>", line 1, in ?
OverflowError: unsigned byte integer is greater than maximum
Without the patch jython *appears* to handle these values as CPython does, but I suspect there may be more involved, as the exception raised by CPython when the unicode formatting fails seems to suggest that CPython runs the value through something similar to unichr():
Python 2.4.4 (#1, Aug 19 2007, 19:54:52) 
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> u'%c' % 256
u'\u0100'
>>> u'%c' % -1
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
OverflowError: %c arg not in range(0x10000) (narrow Python build)
>>> unichr(-1)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ValueError: unichr() arg not in range(0x10000) (narrow Python build)  | 
   
  
 
|
 
| Date | 
User | 
Action | 
Args | 
 
| 2008-02-20 17:18:47 | admin | link | issue1780767 messages |  
| 2008-02-20 17:18:47 | admin | create |  |  
 
 
 |