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

PR: Check for bsd in sys.platform and use sh as a default shell on BSD systems #341

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

spchamp
Copy link

@spchamp spchamp commented Mar 10, 2023

On BSD platforms, the sys.platform test for a default shell in confpage.py may fall through to the Darwin case. This may result in an error as follows, also preventing the display of the Spyder Preferences window.

Traceback (most recent call last):
  File "/usr/home/gimbal/wk/python_wk/spyder_sandbox/env/lib/python3.11/site-packages/spyder/plugins/preferences/plugin.py", line 276, in <lambda>
    lambda: self.open_dialog(main.prefs_dialog_size))
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/home/gimbal/wk/python_wk/spyder_sandbox/env/lib/python3.11/site-packages/spyder/plugins/preferences/plugin.py", line 256, in open_dialog
    container.create_dialog(
  File "/usr/home/gimbal/wk/python_wk/spyder_sandbox/env/lib/python3.11/site-packages/spyder/plugins/preferences/widgets/container.py", line 58, in create_dialog
    page.initialize()
  File "/usr/home/gimbal/wk/python_wk/spyder_sandbox/env/lib/python3.11/site-packages/spyder/plugins/preferences/api.py", line 86, in initialize
    self.setup_page()
  File "/usr/home/gimbal/wk/python_wk/spyder_sandbox/env/lib/python3.11/site-packages/spyder_terminal/confpage.py", line 55, in setup_page
    if mac_ver >= LooseVersion('10.15.0'):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/home/gimbal/wk/python_wk/spyder_sandbox/env/lib/python3.11/site-packages/setuptools/_distutils/version.py", line 90, in __ge__
    c = self._cmp(other)
        ^^^^^^^^^^^^^^^^
  File "/usr/home/gimbal/wk/python_wk/spyder_sandbox/env/lib/python3.11/site-packages/setuptools/_distutils/version.py", line 350, in _cmp
    if self.version == other.version:
       ^^^^^^^^^^^^
AttributeError: 'LooseVersion' object has no attribute 'version'

This patch adds a test for 'bsd' in sys.platform, here using 'sh' as a default shell for confpage.py

When the Spyder Issue reporter popped up with this issue, I'd originally reported it to the spyder project. Noticing the source references in the backtrace available in the Issue reporter window, I'll try to retract or close the issue there.

Fixes #342.

On BSD platforms, the sys.platform test in confpage.py may fall through
to the Darwin case.

This adds a test for 'bsd' in sys.platform, here using 'sh' as a default
shell for confpage.py
@spchamp
Copy link
Author

spchamp commented Mar 10, 2023

tested on FreeBSD 13.2
image

@ccordoba12 ccordoba12 changed the title check for 'bsd' in sys.platform, using sh as a default shell PR: Check for bsd in sys.platform and use sh as a default shell on BSD systems Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

spyder_terminal - Problem when opening Preferences with local build on FreeBSD 13, Python 3.11
1 participant