Message141638
See my last paragraph: I propose to deliver a single patch that fixes both this bug and issue12675. I hope this is OK. (If you prefer, I'll try to split the patch in two.)
I just noticed another bug in untokenize(): in compatibility mode, if untokenize() is passed an iterator rather than a list, then the first token gets discarded:
Python 3.3.0a0 (default:c099ba0a278e, Aug 2 2011, 12:35:03)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from tokenize import untokenize
>>> from token import *
>>> untokenize([(NAME, 'hello')])
'hello '
>>> untokenize(iter([(NAME, 'hello')]))
''
No-one's noticed this because the unit tests only ever pass lists to untokenize(). |
|
Date |
User |
Action |
Args |
2011-08-04 23:01:01 | gdr@garethrees.org | set | recipients:
+ gdr@garethrees.org, ezio.melotti, sandro.tosi |
2011-08-04 23:01:01 | gdr@garethrees.org | set | messageid: <1312498861.23.0.594872824679.issue12691@psf.upfronthosting.co.za> |
2011-08-04 23:01:00 | gdr@garethrees.org | link | issue12691 messages |
2011-08-04 23:01:00 | gdr@garethrees.org | create | |
|