Benjamin Peterson
274a76323c
properly handle the single null-byte file ( closes #24022 )
2016-09-18 23:41:11 -07:00
Serhiy Storchaka
5d7d26c403
Issue #25388 : Fixed tokenizer hang when processing undecodable source code
...
with a null byte.
2015-11-14 15:14:29 +02:00
Benjamin Peterson
223546d55c
add missing NULL checks to get_coding_spec ( closes #24854 )
2015-08-13 21:52:56 -07:00
Serhiy Storchaka
3eb554fc82
Issue #22221 : Backported fixes from Python 3 (issue #18960 ).
...
* Now the source encoding declaration on the second line isn't effective if
the first line contains anything except a comment. This affects compile(),
eval() and exec() too.
* 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.
2014-09-05 10:22:05 +03:00
Ned Deily
24b8209a4e
Issue #21789 : fix broken link (reported by Jan Varho)
2014-06-17 12:24:53 -07:00
Benjamin Peterson
93e51aac54
allow the keyword else immediately after (no space) an integer ( closes #21642 )
2014-06-07 12:36:39 -07:00
Benjamin Peterson
22d9ee7e17
complain if the codec doesn't return unicode
2013-12-28 10:33:58 -06:00
Serhiy Storchaka
729ad5cf56
Issue #18038 : SyntaxError raised during compilation sources with illegal
...
encoding now always contains an encoding name.
2013-06-09 16:54:56 +03:00
Stefan Krah
3db4161011
Issue #9020 : The Py_IS* macros from pyctype.h should generally only be
...
used with signed/unsigned char arguments. For integer arguments, EOF
has to be handled separately.
2010-06-24 09:33:05 +00:00
Antoine Pitrou
c83ea137d7
Untabify C files. Will watch buildbots.
2010-05-09 14:46:46 +00:00
Benjamin Peterson
88623d76b4
use our own locale independent ctype macros
...
requires building pyctype.o into pgen
2010-04-03 23:03:35 +00:00
Benjamin Peterson
4ceeeb09d8
ensure that the locale does not affect the tokenization of identifiers
2010-04-03 22:48:51 +00:00
Victor Stinner
6664426d7c
Issue #3137 : Don't ignore errors at startup, especially a keyboard interrupt
...
(SIGINT). If an error occurs while importing the site module, the error is
printed and Python exits. Initialize the GIL before importing the site
module.
2010-03-10 22:30:19 +00:00
Victor Stinner
d23d3930ff
Issue #7820 : The parser tokenizer restores all bytes in the right if the BOM
...
check fails.
Fix an assertion in pydebug mode.
2010-03-02 23:20:02 +00:00
Benjamin Peterson
42d63847c3
rewrite translate_newlines for clarity
2009-12-06 17:37:48 +00:00
Benjamin Peterson
e36199b49d
fix several compile() issues by translating newlines in the tokenizer
2009-11-12 23:39:44 +00:00
Benjamin Peterson
e3383b8e8f
spelling
2009-11-07 01:04:38 +00:00
Benjamin Peterson
9586cf8677
fix some coding style
2009-10-09 21:48:14 +00:00
Benjamin Peterson
08a0bbc846
don't mask encoding errors when decoding a string #6289
2009-06-16 00:29:31 +00:00
Andrew M. Kuchling
110a48cf60
#3367 : revert rev. 65539: this change causes test_parser to fail
2008-08-05 02:05:23 +00:00
Andrew M. Kuchling
efa61bc15f
#3367 from Kristjan Valur Jonsson:
...
If a PyTokenizer_FromString() is called with an empty string, the
tokenizer's line_start member never gets initialized. Later, it is
compared with the token pointer 'a' in parsetok.c:193 and that behavior
can result in undefined behavior.
2008-08-05 01:38:08 +00:00
Gregory P. Smith
dd96db63f6
This reverts r63675 based on the discussion in this thread:
...
http://mail.python.org/pipermail/python-dev/2008-June/079988.html
Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names
in the spirit of 3.0 are available via a #define only. See the email thread.
2008-06-09 04:58:54 +00:00
Christian Heimes
593daf545b
Renamed PyString to PyBytes
2008-05-26 12:51:38 +00:00
Amaury Forgeot d'Arc
5216721a53
Issue2681: the literal 0o8 was wrongly accepted, and evaluated as float(0.0).
...
This happened only when 8 is the first digit.
Credits go to Lukas Meuser.
2008-04-24 18:07:05 +00:00
Neal Norwitz
d183bdd6fb
Revert r61969 which added casts to Py_CHARMASK to avoid compiler warnings.
...
Rather than sprinkle casts throughout the code, change Py_CHARMASK to
always cast it's result to an unsigned char. This should ensure we
do the right thing when accessing an array with the result.
2008-03-28 04:58:51 +00:00