Skip to content

Commits on Dec 6, 2022

  1. gh-100050: Fix an assertion error when raising unclosed parenthesis e…

    …rrors in the tokenizer (GH-100065)
    
    Automerge-Triggered-By: GH:pablogsal
    pablogsal committed Dec 6, 2022

Commits on Nov 30, 2022

  1. gh-99891: Fix infinite recursion in the tokenizer when showing warnin…

    …gs (GH-99893)
    
    Automerge-Triggered-By: GH:pablogsal
    pablogsal committed Nov 30, 2022

Commits on Nov 15, 2022

  1. gh-81057: Move Globals in Core Code to _PyRuntimeState (gh-99496)

    This is the first of several changes to consolidate non-object globals in core code.
    
    #81057
    ericsnowcurrently committed Nov 15, 2022
  2. gh-99300: Use Py_NewRef() in Python/Python-ast.c (#99499)

    Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and
    Py_XNewRef() in Python/Python-ast.c.
    
    Update Parser/asdl_c.py to regenerate code.
    vstinner committed Nov 15, 2022

Commits on Nov 14, 2022

  1. gh-81057: Move Global Variables Holding Objects to _PyRuntimeState. (g…

    …h-99487)
    
    This moves nearly all remaining object-holding globals in core code (other than static types).
    
    #81057
    ericsnowcurrently committed Nov 14, 2022

Commits on Nov 10, 2022

  1. gh-99300: Use Py_NewRef() in Parser/ directory (#99330)

    Replace Py_INCREF() with Py_NewRef() in C files of the Parser/
    directory and in the PEG generator.
    vstinner committed Nov 10, 2022
  2. gh-99300: Use Py_NewRef() in Python/ directory (#99317)

    Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and
    Py_XNewRef() in C files of the Python/ directory.
    
    Update Parser/asdl_c.py to regenerate Python/Python-ast.c.
    vstinner committed Nov 10, 2022

Commits on Nov 3, 2022

  1. gh-98401: Invalid escape sequences emits SyntaxWarning (#99011)

    A backslash-character pair that is not a valid escape sequence now
    generates a SyntaxWarning, instead of DeprecationWarning.  For
    example, re.compile("\d+\.\d+") now emits a SyntaxWarning ("\d" is an
    invalid escape sequence), use raw strings for regular expression:
    re.compile(r"\d+\.\d+"). In a future Python version, SyntaxError will
    eventually be raised, instead of SyntaxWarning.
    
    Octal escapes with value larger than 0o377 (ex: "\477"), deprecated
    in Python 3.11, now produce a SyntaxWarning, instead of
    DeprecationWarning. In a future Python version they will be
    eventually a SyntaxError.
    
    codecs.escape_decode() and codecs.unicode_escape_decode() are left
    unchanged: they still emit DeprecationWarning.
    
    * The parser only emits SyntaxWarning for Python 3.12 (feature
      version), and still emits DeprecationWarning on older Python
      versions.
    * Fix SyntaxWarning by using raw strings in Tools/c-analyzer/ and
      wasm_build.py.
    vstinner committed Nov 3, 2022

Commits on Nov 1, 2022

  1. gh-98931: Improve error message when the user types 'import x from y'…

    … instead of 'from y import x' (#98932)
    pablogsal committed Nov 1, 2022

Commits on Oct 17, 2022

  1. gh-97669: Create Tools/build/ directory (#97963)

    Create Tools/build/ directory. Move the following scripts from
    Tools/scripts/ to Tools/build/:
    
    * check_extension_modules.py
    * deepfreeze.py
    * freeze_modules.py
    * generate_global_objects.py
    * generate_levenshtein_examples.py
    * generate_opcode_h.py
    * generate_re_casefix.py
    * generate_sre_constants.py
    * generate_stdlib_module_names.py
    * generate_token.py
    * parse_html5_entities.py
    * smelly.py
    * stable_abi.py
    * umarshal.py
    * update_file.py
    * verify_ensurepip_wheels.py
    
    Update references to these scripts.
    vstinner committed Oct 17, 2022

Commits on Oct 6, 2022

  1. gh-97973: Return all necessary information from the tokenizer (GH-97984)

    Right now, the tokenizer only returns type and two pointers to the start and end of the token.
    This PR modifies the tokenizer to return the type and set all of the necessary information,
    so that the parser does not have to this.
    lysnikolaou committed Oct 6, 2022

Commits on Sep 17, 2022

  1. gh-91210: Improve error message when non-default param follows default (

    GH-95933)
    
    - Improve error message when parameter without a default follows one with a default
    - Show same error message when positional-only params precede the default/non-default sequence
    lysnikolaou committed Sep 17, 2022

Commits on Sep 13, 2022

  1. gh-96678: Fix UB of null pointer arithmetic (GH-96782)

    Automerge-Triggered-By: GH:pablogsal
    matthiasgoergens committed Sep 13, 2022

Commits on Sep 7, 2022

  1. gh-96268: Fix loading invalid UTF-8 (#96270)

    This makes tokenizer.c:valid_utf8 match stringlib/codecs.h:decode_utf8.
    
    It also fixes an off-by-one error introduced in 3.10 for the line number when the tokenizer reports bad UTF8.
    mdboom committed Sep 7, 2022

Commits on Sep 2, 2022

  1. gh-95778: CVE-2020-10735: Prevent DoS by very large int() (#96499)

    Integer to and from text conversions via CPython's bignum `int` type is not safe against denial of service attacks due to malicious input. Very large input strings with hundred thousands of digits can consume several CPU seconds.
    
    This PR comes fresh from a pile of work done in our private PSRT security response team repo.
    
    Signed-off-by: Christian Heimes [Red Hat] <christian@python.org>
    Tons-of-polishing-up-by: Gregory P. Smith [Google] <greg@krypto.org>
    Reviews via the private PSRT repo via many others (see the NEWS entry in the PR).
    
    <!-- gh-issue-number: gh-95778 -->
    * Issue: gh-95778
    <!-- /gh-issue-number -->
    
    I wrote up [a one pager for the release managers](https://docs.google.com/document/d/1KjuF_aXlzPUxTK4BMgezGJ2Pn7uevfX7g0_mvgHlL7Y/edit#). Much of that text wound up in the Issue. Backports PRs already exist. See the issue for links.
    gpshead committed Sep 2, 2022

Commits on Jul 28, 2022

  1. gh-95355: Check tokens[0] after allocating memory (GH-95356)

    #95355
    
    Automerge-Triggered-By: GH:pablogsal
    imzhuhl committed Jul 28, 2022

Commits on Jul 24, 2022

  1. gh-95185: Check recursion depth in the AST constructor (#95186)

    Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
    pablogsal and serhiy-storchaka committed Jul 24, 2022

Commits on Jul 18, 2022

  1. gh-94949: Disallow parsing parenthesised ctx mgr with old feature_ver…

    …sion (#94950)
    
    * gh-94949: Disallow parsing parenthesised ctx manager with old feature_version
    
    * 📜🤖 Added by blurb_it.
    
    * Allow it with feature_version=(3, 9) as well
    
    Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
    hauntsaninja and blurb-it[bot] committed Jul 18, 2022
  2. gh-94947: Disallow parsing walrus with feature_version < (3, 8) (#94948)

    * gh-94947: Disallow parsing walrus with feature_version < (3, 8)
    
    * oops, commit the parser
    
    * 📜🤖 Added by blurb_it.
    
    Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
    hauntsaninja and blurb-it[bot] committed Jul 18, 2022

Commits on Jul 16, 2022

Older