Visitar URL original
Internals of exceptions on ThreadState `_ts` struct have moved · Issue #1955 · cython/cython · GitHub
Skip to content

Internals of exceptions on ThreadState _ts struct have moved #1955

Closed

Description

@tacaswell

python/cpython@ae3087c / https://bugs.python.org/issue25612 / python/cpython#1773 re-arranged how exception information is stored and moved exc_type, exc_value, and exc_tracback into a _err_stackitem struct pointed to by exc_info.

Activity

  1. added this to the 0.27.3 milestone on Oct 28, 2017
  2. warsaw commented on Nov 3, 2017

    @warsaw

    Maybe I'm doing something wrong but I'm still unable to build lxml from git head of python3.7, cython, and lxml. The generated etree.c file still references exc_type.

    Here are the steps I've used to reproduce the problem:

    • macOS 10.12.6, Xcode Version 9.1 (9B55)
    • clone the CPython repo, configure, make, make altinstall (i.e. to /usr/local)
    • python3.7 -mvenv /tmp/py37
    • source /tmp/py37/bin/activate
    • clone the Cython repo, cd into that
    • pip install -e . from inside the virtualenv
    (py37) % type cython
    cython is /tmp/py37/bin/cython
    (py37) % cython --version
    Cython version 0.28a0
    
    • clone the lxml repo and cd into that
    • make inplace

    This yields tons of warnings and one error. But it's definitely using the pip installed Cython:

    (py37) % find . -name \*.c
    (py37) % make inplace
    python setup.py  build_ext -i  --with-cython --warnings --with-coverage
    Building lxml version 4.1.0.
    Building with Cython 0.28a0.
    ...
    
    src/lxml/etree.c:259432:24: error: no member named 'exc_type' in 'struct _ts'
        if (!__pyx_tstate->exc_type) {
             ~~~~~~~~~~~~  ^
    356 warnings and 1 error generated.
    Compile failed: command 'gcc' failed with exit status 1
    
        if (!__pyx_tstate->exc_type) {
            Py_INCREF(PyExc_StopIteration);
            __Pyx_ErrRestore(PyExc_StopIteration, exc, NULL);
            return;
        }

    So what am I doing wrong, or is this a bug in lxml, or is Cython still not quite fixed yet?

  3. added a commit that references this issue on Nov 3, 2017
    8ad16fc
  4. scoder commented on Nov 3, 2017

    @scoder
    Contributor

    You are right, there was a left-over. Thanks for insisting.

  5. warsaw commented on Nov 3, 2017

    @warsaw

    Cool thanks. I'll keep an eye on that and try git head again once that lands.

  6. warsaw commented on Nov 3, 2017

    @warsaw

    Oh, nm. I see that's a commit on master. I was able to build lxml with this change... thanks for fixing this! Now for the inevitable follow up question, do you have an ETA for a 0.28 release? :)

  7. tacaswell commented on Nov 4, 2017

    @tacaswell
    ContributorAuthor

    Sorry I missed one 😞

  8. scoder commented on Nov 4, 2017

    @scoder
    Contributor

    I sneaked it into 0.27.3, just released.

  9. warsaw commented on Nov 4, 2017

    @warsaw

    Awesome, thanks! I'll give that a try on Monday.

  10. warsaw commented on Nov 6, 2017

    @warsaw

    FYI, 0.27.3 works great. Thanks!

  11. markshannon commented on Jul 1, 2018

    @markshannon

    I suspect that this hasn't been fixed. See #1956 (comment)

  12. scoder commented on Jul 2, 2018

    @scoder
    Contributor

    The syntax fix was correct. The question is rather whether the original implementation was semantically correct. Could well be that there are more/other things to do here now.

    Besides, to verify that the expected Cython version was used to generated a specific C file, look at the version marker in the first line of the file. head -1 somefile.c is a useful remote debugging helper here, for those who have to deal with users who complain about failures even after installing the latest Cython.

  13. added a commit that references this issue on Jul 5, 2018
  14. added a commit that references this issue on Nov 19, 2019
  15. added a commit that references this issue on Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions