[proxy] web.archive.org← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light

python/cpython

vstinner

Commits on Jan 14, 2021

  1. bpo-42827: Fix crash on SyntaxError in multiline expressions (GH-24140)

    When trying to extract the error line for the error message there
    are two distinct cases:
    
    1. The input comes from a file, which means that we can extract the
       error line by using `PyErr_ProgramTextObject` and which we already
       do.
    2. The input does not come from a file, at which point we need to get
       the source code from the tokenizer:
       * If the tokenizer's current line number is the same with the line
         of the error, we get the line from `tok->buf` and we're ready.
       * Else, we can extract the error line from the source code in the
         following two ways:
         * If the input comes from a string we have all the input
           in `tok->str` and we can extract the error line from it.
         * If the input comes from stdin, i.e. the interactive prompt, we
           do not have access to the previous line. That's why a new
           field `tok->stdin_content` is added which holds the whole input for the
           current (multiline) statement or expression. We can then extract the
           error line from `tok->stdin_content` like we do in the string case above.
    
    Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>

Commits on Jan 13, 2021

  1. bpo-42901: [Enum] move member creation to `__set_name__` (GH-24196)

    `type.__new__` calls `__set_name__` and `__init_subclass__`, which means
    that any work metaclasses do after calling `super().__new__()` will not
    be available to those two methods.  In particular, `Enum` classes that
    want to make use of `__init_subclass__` will not see any members.
    
    Almost all customization is therefore moved to before the
    `type.__new__()` call, including changing all members to a proto member
    descriptor with a `__set_name__` that will do the final conversion of a
    member to be an instance of the `Enum` class.

Commits on Jan 12, 2021

  1. bpo-42874: Remove grep -qE options for Solaris 10 compatibility (GH-2…

    …4200)
    
    According to [bpo-42874](), some versions of grep do not support the `-q` and `-E` options. Although both options are used elsewhere in the configure script, this particular bit of validation can be achieved without them,
    so there's no real harm in using a grep call with no flags.
    
    Would be good to get some people taking advantage of the `--with-tzpath` arguments in the wild to try this out.. Local testing seems to indicate that this does the same thing, but I don't know that we have any buildbots using this option. Maybe @pablogsal?
    
    [bpo-42874]():

Commits on Jan 8, 2021

  1. bpo-42802: Remove distutils bdist_wininst command (GH-24043)

    The distutils bdist_wininst command deprecated in Python 3.8 has been
    removed. The distutils bidst_wheel command is now recommended to
    distribute binary packages on Windows.
    
    * Remove Lib/distutils/command/bdist_wininst.py
    * Remove PC/bdist_wininst/ project
    * Remove Lib/distutils/command/wininst-*.exe programs
    * Remove all references to bdist_wininst