python/cpython

Commits on Sep 4, 2020

Commits on Sep 3, 2020

Commits on Sep 2, 2020

  1. bpo-41690: Use a loop to collect args in the parser instead of recurs…

    …ion (GH-22053)
    
    This program can segfault the parser by stack overflow:
    
    ```
    import ast
    
    code = "f(" + ",".join(['a' for _ in range(100000)]) + ")"
    print("Ready!")
    ast.parse(code)
    ```
    
    the reason is that the rule for arguments has a simple recursion when collecting args:
    
    args[expr_ty]:
        [...]
        | a=named_expression b=[',' c=args { c }] {
            [...] }
  2. bpo-41675: Modernize siginterrupt calls (GH-22028)

    siginterrupt is deprecated:
    
    ./Modules/signalmodule.c:667:5: warning: ‘siginterrupt’ is deprecated: Use sigaction with SA_RESTART instead [-Wdeprecated-declarations]
      667 |     if (siginterrupt(signalnum, flag)<0) {

Commits on Sep 1, 2020