From: Serhiy Storchaka Date: Thu, 9 Jan 2014 16:41:59 +0000 (+0200) Subject: Issue #18960: Fix bugs with Python source code encoding in the second line. X-Git-Tag: v3.4.0b3~200 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7282ff6d5b56825e74c0715aea86e927d2fd339f;p=thirdparty%2FPython%2Fcpython.git Issue #18960: Fix bugs with Python source code encoding in the second line. * The first line of Python script could be executed twice when the source encoding (not equal to 'utf-8') was specified on the second line. * Now the source encoding declaration on the second line isn't effective if the first line contains anything except a comment. * As a consequence, 'python -x' works now again with files with the source encoding declarations specified on the second file, and can be used again to make Python batch files on Windows. * The tokenize module now ignore the source encoding declaration on the second line if the first line contains anything except a comment. * IDLE now ignores the source encoding declaration on the second line if the first line contains anything except a comment. * 2to3 and the findnocoding.py script now ignore the source encoding declaration on the second line if the first line contains anything except a comment. --- 7282ff6d5b56825e74c0715aea86e927d2fd339f diff --cc Misc/NEWS index 72e26b82cf0a,6bf5a3091f3a..cb59a68a1e8a --- a/Misc/NEWS +++ b/Misc/NEWS @@@ -15,64 -22,8 +22,77 @@@ Core and Builtin already cached the zip's table of contents we detect this and recover rather than read bad data from the .zip (causing odd import errors). +Library +------- + ++- Issue #18960: The tokenize module now ignore the source encoding declaration ++ on the second line if the first line contains anything except a comment. ++ +- Issue #20078: Reading malformed zipfiles no longer hangs with 100% CPU + consumption. + +- Issue #20113: os.readv() and os.writev() now raise an OSError exception on + error instead of returning -1. + +- Issue #19719: Make importlib.abc.MetaPathFinder.find_module(), + PathEntryFinder.find_loader(), and Loader.load_module() use PEP 451 APIs to + help with backwards-compatibility. + +- Issue #20144: inspect.Signature now supports parsing simple symbolic + constants as parameter default values in __text_signature__. + +- Issue #20072: Fixed multiple errors in tkinter with wantobjects is False. + ++IDLE ++---- ++ ++- Issue #18960: IDLE now ignores the source encoding declaration on the second ++ line if the first line contains anything except a comment. ++ +Tools/Demos +----------- + ++- Issue #18960: 2to3 and the findnocoding.py script now ignore the source ++ encoding declaration on the second line if the first line contains anything ++ except a comment. ++ +- Issue #19723: The marker comments Argument Clinic uses have been changed + to improve readability. + +- Issue #20157: When Argument Clinic renames a parameter because its name + collides with a C keyword, it no longer exposes that rename to PyArg_Parse. + +- Issue #20141: Improved Argument Clinic's support for the PyArg_Parse "O!" + format unit. + +- Issue #20144: Argument Clinic now supports simple symbolic constants + as parameter default values. + +- Issue #20143: The line numbers reported in Argument Clinic errors are + now more accurate. + +- Issue #20142: Py_buffer variables generated by Argument Clinic are now + initialized with a default value. + +Build +----- + +- Issue #12837: Silence a tautological comparison warning on OS X under Clang in + socketmodule.c. + +What's New in Python 3.4.0 Beta 2? +================================== + +Release date: 2014-01-05 + +Core and Builtins +----------------- + - Issue #17432: Drop UCS2 from names of Unicode functions in python3.def. +- Issue #19526: Exclude all new API from the stable ABI. Exceptions can be + made if a need is demonstrated. + - Issue #19969: PyBytes_FromFormatV() now raises an OverflowError if "%c" argument is not in range [0; 255].