Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-2427

shibokensupport/feature.py triggers recursion error with py module (pytest)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • 6.5.2
    • Shiboken
    • None
    • Linux/X11

    Description

      Using pytest with the PySide6 and Python 3.8 I noticed the following error (and variations depending on the import used).

       

        File "shibokensupport/signature/loader.py", line 61, in feature_imported 
       File "shibokensupport/feature.py", line 137, in feature_imported 
       File "shibokensupport/feature.py", line 148, in _mod_uses_pyside 
       File "/usr/lib/python3.8/inspect.py", line 997, in getsource 
         lines, lnum = getsourcelines(object) 
       File "/usr/lib/python3.8/inspect.py", line 979, in getsourcelines 
         lines, lnum = findsource(object) 
       File "/usr/lib/python3.8/inspect.py", line 794, in findsource 
         lines = linecache.getlines(file, module.__dict__) 
       File "/usr/local/lib/python3.8/dist-packages/py/_vendored_packages/apipkg/__init__.py", line 177, in __dict__ 
         self.__makeattr(name) 
       File "/usr/local/lib/python3.8/dist-packages/py/_vendored_packages/apipkg/__init__.py", line 157, in __makeattr 
         result = importobj(modpath, attrname) 
       File "/usr/local/lib/python3.8/dist-packages/py/_vendored_packages/apipkg/__init__.py", line 75, in importobj 
         module = __import__(modpath, None, None, ["__doc__"]) 
       File "shibokensupport/signature/loader.py", line 61, in feature_imported 
       File "shibokensupport/feature.py", line 137, in feature_imported 
       File "shibokensupport/feature.py", line 148, in _mod_uses_pyside 
       File "/usr/lib/python3.8/inspect.py", line 997, in getsource 
         lines, lnum = getsourcelines(object) 
       File "/usr/lib/python3.8/inspect.py", line 978, in getsourcelines 
         object = unwrap(object) 
       File "/usr/lib/python3.8/inspect.py", line 520, in unwrap 
         while _is_wrapper(func): 
       File "/usr/lib/python3.8/inspect.py", line 511, in _is_wrapper 
         return hasattr(f, '__wrapped__') 
      RecursionError: maximum recursion depth exceeded while calling a Python object

       

       

      Investigating into this I found the source to be in shibokensupport/feature.py

       

      This issue can be nicely reproduced with

      import py
      import PySide6.Qtcore
      import shibokensupport.feature
      shibokensupport.feature.__init__()

      Other options include calling from {}feature{} import snake_case after importing py (done by pytest internally), which calls this method.

      Might be related to PYSIDE-2393

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              kleint Friedemann Kleint
              machinekoder Alex Roessler
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes