Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"ImportError" exception raised while using "rez-gui" in Python 3. #848

Closed
KelSolaar opened this issue Feb 6, 2020 · 6 comments
Closed
Labels

Comments

@KelSolaar
Copy link
Contributor

Hi,

I'm testing Rez with Python 3 and a StringIO import in rezgui\dialogs\ResolveDialog.py raises an ImportError exception:

C:\Users\thomas>rez-gui
Traceback (most recent call last):
  File "C:\Program Files\Python37\Lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Program Files\Python37\Lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Program Files\rez\Scripts\rez\rez-gui.exe\__main__.py", line 7, in <module>
  File "c:\progra~1\rez\lib\site-packages\rez\cli\_entry_points.py", line 159, in run_rez_gui
    return run("gui")
  File "c:\progra~1\rez\lib\site-packages\rez\cli\_main.py", line 152, in run
    returncode = run_cmd()
  File "c:\progra~1\rez\lib\site-packages\rez\cli\_main.py", line 144, in run_cmd
    return opts.func(opts, opts.parser, extra_arg_groups)
  File "c:\progra~1\rez\lib\site-packages\rez\cli\gui.py", line 20, in command
    from rezgui.app import run
  File "c:\progra~1\rez\lib\site-packages\rezgui\app.py", line 2, in <module>
    from rezgui.windows.MainWindow import MainWindow
  File "c:\progra~1\rez\lib\site-packages\rezgui\windows\MainWindow.py", line 5, in <module>
    from rezgui.windows.ContextSubWindow import ContextSubWindow
  File "c:\progra~1\rez\lib\site-packages\rezgui\windows\ContextSubWindow.py", line 3, in <module>
    from rezgui.widgets.ContextManagerWidget import ContextManagerWidget
  File "c:\progra~1\rez\lib\site-packages\rezgui\widgets\ContextManagerWidget.py", line 11, in <module>
    from rezgui.dialogs.ResolveDialog import ResolveDialog
  File "c:\progra~1\rez\lib\site-packages\rezgui\dialogs\ResolveDialog.py", line 11, in <module>
    import StringIO
ModuleNotFoundError: No module named 'StringIO'

Leads me to the following: What is the status with Python 3 support?

Cheers,

Thomas

@KelSolaar
Copy link
Contributor Author

KelSolaar commented Feb 6, 2020

So there are at least a few places where it will break on Python 3: https://github.com/nerdvegas/rez/search?q=import+StringIO&unscoped_q=import+StringIO

Everytime StringIO is imported directly instead of io.StringIO outside a try/except block basically.

@nerdvegas
Copy link
Contributor

nerdvegas commented Feb 6, 2020 via email

@KelSolaar
Copy link
Contributor Author

KelSolaar commented Feb 6, 2020

Hi @nerdvegas,

As per my PR (just above) support is not full-full, the plugin manager will break when an exception is raised while loading a plugin. Might need some more coverage in that particular block!

Cheers,

Thomas

@JeanChristopheMorinPerso
Copy link
Member

To be fair, our actual coverage is quite weak and is an area where we need to improve. I'm hoping to get back on working on rez this week-end and I'll see if I can push my work on pytest. Once that's done, it's going to be easier (I hope) to improve our test suite).

@nerdvegas
Copy link
Contributor

nerdvegas commented Feb 6, 2020 via email

@KelSolaar
Copy link
Contributor Author

No problems should be fixed by #850 ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants