Giter VIP home page Giter VIP logo

Comments (6)

fancidev avatar fancidev commented on July 27, 2024

This is a bug with _create_notifier() in _base_events.py. The function defines a class with a global name. However, the global statement documentation says:

Names listed in a global statement must not be defined as formal parameters, or as targets in with statements or except clauses, or in a for target list, class definition, function definition, import statement, or variable annotation.

from qtinter.

fancidev avatar fancidev commented on July 27, 2024

Fixed in commit 37e1edb.

from qtinter.

fancidev avatar fancidev commented on July 27, 2024

Commit 37e1edb didn't fix the issue because the error was reproduced consistently in test runs after the commit:

tests #96: Python-3.7-PySide6-windows-latest

tests #97: Python-3.7-PySide6-windows-latest

tests #98:
Python-3.7-PySide6-windows-latest

from qtinter.

fancidev avatar fancidev commented on July 27, 2024

Fixed in commit ded0b23 by not using enum.Enum under Python 3.7.

from qtinter.

fancidev avatar fancidev commented on July 27, 2024

Same error occurred again, still with Python 3.7 + PySide6 but on macOS:

Python-3.7-PySide6-macos-latest

from qtinter.

fancidev avatar fancidev commented on July 27, 2024

Added adhoc workflow to investigate this problem. adhoc runs 2 to 8 show some interesting results.

adhoc#2 passes but adhoc#3 fails. The only difference is that adhoc#3 runs test.test_asyncio as a prior step before running tests. It's unclear why this makes a difference.

adhoc#4 to 7 are a series of runs with increasing logging. adhoc#7 shows that when _QiNotifierObject is first created, _QiNotifierObject.__init__ is <function _create_notifier.<locals>._QiNotifierObjectImpl.__init__ at 0x108dbf0e0>. But when AttributeError is raised later, _QiNotifierObject.__init__ has changed to <method-wrapper '__init__' of Shiboken.ObjectType object at 0x7f8258c9d340>.

This change is unexpected. It might be related to two factors: (1) AttributeError starts after a KeyboardInterrupt test, and (2) _QiNotifierObjectImpl is defined as a function-local class. This suggests that SIGINT might have broken the internal state of a locally-defined QObject-derived class.

adhoc#8 attempts a workaround of this by making _QiNotifierObject a module-level (instead of function-local) class. To keep lazy resolution of Qt binding, a _QiObject class is added to qtinter.bindings.

This appears to have fixed the issue.

from qtinter.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.