]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
- Issue #719888: Updated tokenize to use a bytes API. generate_tokens has been
authorTrent Nelson <trent.nelson@snakebite.org>
Tue, 18 Mar 2008 22:41:35 +0000 (22:41 +0000)
committerTrent Nelson <trent.nelson@snakebite.org>
Tue, 18 Mar 2008 22:41:35 +0000 (22:41 +0000)
commit428de65ca99492436130165bfbaeb56d6d1daec7
treed6c11516a28d8ca658e1f35ac6d7cc802958e336
parent112367a980481d54f8c21802ee2538a3485fdd41
- Issue #719888: Updated tokenize to use a bytes API. generate_tokens has been
  renamed tokenize and now works with bytes rather than strings. A new
  detect_encoding function has been added for determining source file encoding
  according to PEP-0263. Token sequences returned by tokenize always start
  with an ENCODING token which specifies the encoding used to decode the file.
  This token is used to encode the output of untokenize back to bytes.

Credit goes to Michael "I'm-going-to-name-my-first-child-unittest" Foord from Resolver Systems for this work.
16 files changed:
Doc/ACKS.txt
Doc/library/tokenize.rst
Doc/whatsnew/3.0.rst
Lib/idlelib/EditorWindow.py
Lib/inspect.py
Lib/test/test_tokenize.py
Lib/test/tokenize_tests-latin1-coding-cookie-and-utf8-bom-sig.txt [new file with mode: 0644]
Lib/test/tokenize_tests-no-coding-cookie-and-utf8-bom-sig-only.txt [new file with mode: 0644]
Lib/test/tokenize_tests-utf8-coding-cookie-and-no-utf8-bom-sig.txt [new file with mode: 0644]
Lib/test/tokenize_tests-utf8-coding-cookie-and-utf8-bom-sig.txt [new file with mode: 0644]
Lib/tokenize.py
Misc/ACKS
Misc/NEWS
Tools/i18n/pygettext.py
Tools/scripts/checkappend.py
Tools/scripts/reindent.py