]> granicus.if.org Git - python/commitdiff
Issue #18960: Fix bugs with Python source code encoding in the second line.
authorSerhiy Storchaka <storchaka@gmail.com>
Thu, 9 Jan 2014 16:41:59 +0000 (18:41 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Thu, 9 Jan 2014 16:41:59 +0000 (18:41 +0200)
* 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.

1  2 
Lib/idlelib/IOBinding.py
Lib/tokenize.py
Misc/NEWS
Parser/tokenizer.c

Simple merge
diff --cc Lib/tokenize.py
Simple merge
diff --cc Misc/NEWS
index 72e26b82cf0ab3d4737a76c3aadda929b8c0a000,6bf5a3091f3a133e2d0ef34455e8c3e7f9940233..cb59a68a1e8a31ee44aa0bb2925c7041ca6322c9
+++ 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].
  
Simple merge