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

shiboken6-genpyi not import 'os'

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3: Somewhat important
    • 6.9.0, 6.10.0
    • 6.8.2
    • Shiboken
    • None
    • Linux/X11
    • d65666b76 (dev), 4dc14dcd0 (6.9), e0e99da26 (6.8)

    Description

      I was trying Shiboken with examples in https://doc.qt.io/qtforpython-6/examples/example_samplebinding_samplebinding.html. After the module was compiled, I tried to create stubs with

      shiboken6-genpyi ./Universe.so 

      which then complains

      Traceback (most recent call last):
        File "<string>", line 1, in <module>
        File "shibokensupport/signature/lib/pyi_generator.py", line 364, in main
      NameError: name 'os' is not defined 

      Inspired by https://bugreports.qt.io/browse/PYSIDE-1994, I then tried

      export SBK_EMBED=0
      shiboken6-genpyi ./Universe.so 

      The error became:

      Traceback (most recent call last):
        File "<string>", line 1, in <module>
        File "/media/project/shibokentest/.venv/lib/python3.10/site-packages/shiboken6/files.dir/shibokensupport/signature/lib/pyi_generator.py", line 364, in main
          qtest_env = os.environ.get("QTEST_ENVIRONMENT", "")
      NameError: name 'os' is not defined 

      After browsing that script and [https://github.com/pyside/pyside-setup/blob/6.8.2/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/pyi_generator.py] I found 'os' is indeed not imported.

       

      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
              tanjor tanjor
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There is 1 open Gerrit change